mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-23 03:59:12 +00:00
stomp some more undefined behavior, PR7775.
llvm-svn: 111337
This commit is contained in:
parent
25446ccf9f
commit
ba9f26fade
@ -2123,15 +2123,16 @@ void APInt::toString(SmallVectorImpl<char> &Str, unsigned Radix,
|
||||
char *BufPtr = Buffer+65;
|
||||
|
||||
uint64_t N;
|
||||
if (Signed) {
|
||||
int64_t I = getSExtValue();
|
||||
if (I < 0) {
|
||||
Str.push_back('-');
|
||||
I = -I;
|
||||
}
|
||||
N = I;
|
||||
} else {
|
||||
if (!Signed) {
|
||||
N = getZExtValue();
|
||||
} else {
|
||||
int64_t I = getSExtValue();
|
||||
if (I >= 0) {
|
||||
N = I;
|
||||
} else {
|
||||
Str.push_back('-');
|
||||
N = -(uint64_t)I;
|
||||
}
|
||||
}
|
||||
|
||||
while (N) {
|
||||
|
Loading…
Reference in New Issue
Block a user