stomp some more undefined behavior, PR7775.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111337 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2010-08-18 00:33:47 +00:00
parent c62a4b0f03
commit 5083912dd7

View File

@ -2123,15 +2123,16 @@ void APInt::toString(SmallVectorImpl<char> &Str, unsigned Radix,
char *BufPtr = Buffer+65; char *BufPtr = Buffer+65;
uint64_t N; uint64_t N;
if (Signed) { if (!Signed) {
int64_t I = getSExtValue();
if (I < 0) {
Str.push_back('-');
I = -I;
}
N = I;
} else {
N = getZExtValue(); N = getZExtValue();
} else {
int64_t I = getSExtValue();
if (I >= 0) {
N = I;
} else {
Str.push_back('-');
N = -(uint64_t)I;
}
} }
while (N) { while (N) {