Fix edge case.
authorNick Lewycky <nicholas@mxc.ca>
Sat, 9 Jun 2007 04:20:33 +0000 (04:20 +0000)
committerNick Lewycky <nicholas@mxc.ca>
Sat, 9 Jun 2007 04:20:33 +0000 (04:20 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37532 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Support/ConstantRange.cpp

index 1e2a6375c457985cbd523c2a003136ba3ce7c22e..966de801be0b082ced58d4bab8cdb32de2adf67c 100644 (file)
@@ -108,7 +108,7 @@ APInt ConstantRange::getUnsignedMin() const {
 APInt ConstantRange::getSignedMax() const {
   APInt SignedMax(APInt::getSignedMaxValue(getBitWidth()));
   if (!isWrappedSet()) {
-    if (getLower().slt(getUpper() - 1))
+    if (getLower().sle(getUpper() - 1))
       return getUpper() - 1;
     else
       return SignedMax;
@@ -130,7 +130,7 @@ APInt ConstantRange::getSignedMax() const {
 APInt ConstantRange::getSignedMin() const {
   APInt SignedMin(APInt::getSignedMinValue(getBitWidth()));
   if (!isWrappedSet()) {
-    if (getLower().slt(getUpper() - 1))
+    if (getLower().sle(getUpper() - 1))
       return getLower();
     else
       return SignedMin;