summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/SystemZ/SystemZFrameLowering.cpp
diff options
context:
space:
mode:
authorAlexey Samsonov <vonosmas@gmail.com>2014-08-20 21:56:43 +0000
committerAlexey Samsonov <vonosmas@gmail.com>2014-08-20 21:56:43 +0000
commitfffd56ecdf348630bba0e1500229f2fa8d7e8101 (patch)
treef2f9c15153ad3a8e39d6e30ddcd64c626c961d5b /llvm/lib/Target/SystemZ/SystemZFrameLowering.cpp
parent7e75cbaf47260f4bd22db4ac64d003e443cca672 (diff)
downloadbcm5719-llvm-fffd56ecdf348630bba0e1500229f2fa8d7e8101.tar.gz
bcm5719-llvm-fffd56ecdf348630bba0e1500229f2fa8d7e8101.zip
Fix undefined behavior (left shift of negative value) in SystemZ backend.
This bug is reported by UBSan. llvm-svn: 216131
Diffstat (limited to 'llvm/lib/Target/SystemZ/SystemZFrameLowering.cpp')
-rw-r--r--llvm/lib/Target/SystemZ/SystemZFrameLowering.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Target/SystemZ/SystemZFrameLowering.cpp b/llvm/lib/Target/SystemZ/SystemZFrameLowering.cpp
index db1a005353b..eff4ae3baf3 100644
--- a/llvm/lib/Target/SystemZ/SystemZFrameLowering.cpp
+++ b/llvm/lib/Target/SystemZ/SystemZFrameLowering.cpp
@@ -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;
OpenPOWER on IntegriCloud