diff --git a/lib/Support/APInt.cpp b/lib/Support/APInt.cpp index c580dd3ba3e..0d4e0f9f752 100644 --- a/lib/Support/APInt.cpp +++ b/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);