mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-25 00:29:20 +00:00
avoid undefined behavior negating minint.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110117 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
84b8ad321b
commit
2359e5193a
@ -735,8 +735,8 @@ static void WriteConstants(unsigned FirstVal, unsigned LastVal,
|
||||
Code = bitc::CST_CODE_UNDEF;
|
||||
} else if (const ConstantInt *IV = dyn_cast<ConstantInt>(C)) {
|
||||
if (IV->getBitWidth() <= 64) {
|
||||
int64_t V = IV->getSExtValue();
|
||||
if (V >= 0)
|
||||
uint64_t V = IV->getSExtValue();
|
||||
if ((int64_t)V >= 0)
|
||||
Record.push_back(V << 1);
|
||||
else
|
||||
Record.push_back((-V << 1) | 1);
|
||||
|
Loading…
Reference in New Issue
Block a user