summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/APInt.cpp
diff options
context:
space:
mode:
authorAhmed Charles <ace2001ac@gmail.com>2012-02-24 19:06:15 +0000
committerAhmed Charles <ace2001ac@gmail.com>2012-02-24 19:06:15 +0000
commit0dca5d8f8c17671183014959627069cf69d667eb (patch)
tree9914ffc012f3300be1868d67d9998054e9819dd7 /llvm/lib/Support/APInt.cpp
parent09b602d85c23d0a4d6925e9bb36d7bbf83c75acc (diff)
downloadbcm5719-llvm-0dca5d8f8c17671183014959627069cf69d667eb.tar.gz
bcm5719-llvm-0dca5d8f8c17671183014959627069cf69d667eb.zip
Fix undefined behavior.
llvm-svn: 151385
Diffstat (limited to 'llvm/lib/Support/APInt.cpp')
-rw-r--r--llvm/lib/Support/APInt.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Support/APInt.cpp b/llvm/lib/Support/APInt.cpp
index c580dd3ba3e..0d4e0f9f752 100644
--- a/llvm/lib/Support/APInt.cpp
+++ b/llvm/lib/Support/APInt.cpp
@@ -1234,7 +1234,7 @@ APInt APInt::lshr(const APInt &shiftAmt) const {
/// @brief Logical right-shift function.
APInt APInt::lshr(unsigned shiftAmt) const {
if (isSingleWord()) {
- if (shiftAmt == BitWidth)
+ if (shiftAmt >= BitWidth)
return APInt(BitWidth, 0);
else
return APInt(BitWidth, this->VAL >> shiftAmt);
OpenPOWER on IntegriCloud