mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-27 00:21:03 +00:00
Fix undefined behavior (left shift of negative value) in SystemZ backend.
This bug is reported by UBSan. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216131 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -294,7 +294,7 @@ static void emitIncrement(MachineBasicBlock &MBB,
|
||||
else {
|
||||
Opcode = SystemZ::AGFI;
|
||||
// Make sure we maintain 8-byte stack alignment.
|
||||
int64_t MinVal = -int64_t(1) << 31;
|
||||
int64_t MinVal = -uint64_t(1) << 31;
|
||||
int64_t MaxVal = (int64_t(1) << 31) - 8;
|
||||
if (ThisVal < MinVal)
|
||||
ThisVal = MinVal;
|
||||
|
Reference in New Issue
Block a user