mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-04-11 20:22:02 +00:00
avoid undefined behavior negating minint.
llvm-svn: 110117
This commit is contained in:
parent
03b02a1ee1
commit
a18c40fa5f
@ -735,8 +735,8 @@ static void WriteConstants(unsigned FirstVal, unsigned LastVal,
|
|||||||
Code = bitc::CST_CODE_UNDEF;
|
Code = bitc::CST_CODE_UNDEF;
|
||||||
} else if (const ConstantInt *IV = dyn_cast<ConstantInt>(C)) {
|
} else if (const ConstantInt *IV = dyn_cast<ConstantInt>(C)) {
|
||||||
if (IV->getBitWidth() <= 64) {
|
if (IV->getBitWidth() <= 64) {
|
||||||
int64_t V = IV->getSExtValue();
|
uint64_t V = IV->getSExtValue();
|
||||||
if (V >= 0)
|
if ((int64_t)V >= 0)
|
||||||
Record.push_back(V << 1);
|
Record.push_back(V << 1);
|
||||||
else
|
else
|
||||||
Record.push_back((-V << 1) | 1);
|
Record.push_back((-V << 1) | 1);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user