forked from OSchip/llvm-project
Support: Remove undefined behavior from &raw_ostream::operator<<
Don't negate signed integer types in &raw_ostream::operator<<(const FormattedNumber &FN). llvm-svn: 218496
This commit is contained in:
parent
beff8bf746
commit
4b3c90f209
|
@ -433,7 +433,7 @@ raw_ostream &raw_ostream::operator<<(const FormattedNumber &FN) {
|
|||
char *EndPtr = NumberBuffer+sizeof(NumberBuffer);
|
||||
char *CurPtr = EndPtr;
|
||||
bool Neg = (FN.DecValue < 0);
|
||||
uint64_t N = Neg ? -FN.DecValue : FN.DecValue;
|
||||
uint64_t N = Neg ? -static_cast<uint64_t>(FN.DecValue) : FN.DecValue;
|
||||
while (N) {
|
||||
*--CurPtr = '0' + char(N % 10);
|
||||
N /= 10;
|
||||
|
|
Loading…
Reference in New Issue