mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-14 11:32:34 +00:00
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:
parent
c62a4b0f03
commit
5083912dd7
@ -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) {
|
||||||
|
Loading…
Reference in New Issue
Block a user