aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorChad Rosier <mcrosier@apple.com>2012-06-08 18:04:52 +0000
committerChad Rosier <mcrosier@apple.com>2012-06-08 18:04:52 +0000
commit28dd960cd1c346c5beef4585d6ea68ae31be0faf (patch)
tree0186b83e858f8f1927c850aa1012ad707a9fbc03 /lib
parentc36d033c08c6148846f61cc7aee4fe0f523af1e5 (diff)
downloadexternal_llvm-28dd960cd1c346c5beef4585d6ea68ae31be0faf.zip
external_llvm-28dd960cd1c346c5beef4585d6ea68ae31be0faf.tar.gz
external_llvm-28dd960cd1c346c5beef4585d6ea68ae31be0faf.tar.bz2
Fix a crash in APInt::lshr when shiftAmt > BitWidth.
Patch by James Benton <jbenton@vmware.com>. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158213 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Support/APInt.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Support/APInt.cpp b/lib/Support/APInt.cpp
index 9b81fe7..6a74883 100644
--- a/lib/Support/APInt.cpp
+++ b/lib/Support/APInt.cpp
@@ -1135,7 +1135,7 @@ APInt APInt::lshr(unsigned shiftAmt) const {
// If all the bits were shifted out, the result is 0. This avoids issues
// with shifting by the size of the integer type, which produces undefined
// results. We define these "undefined results" to always be 0.
- if (shiftAmt == BitWidth)
+ if (shiftAmt >= BitWidth)
return APInt(BitWidth, 0);
// If none of the bits are shifted out, the result is *this. This avoids