Skip to content
Snippets Groups Projects
Commit d18b1603 authored by Nick Lewycky's avatar Nick Lewycky
Browse files

Fix edge case.

llvm-svn: 37532
parent 2117d1f2
No related branches found
No related tags found
No related merge requests found
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment