summaryrefslogtreecommitdiff
path: root/lib/Support/ConstantRange.cpp
diff options
context:
space:
mode:
authorNuno Lopes <nunoplopes@sapo.pt>2012-06-28 00:59:33 +0000
committerNuno Lopes <nunoplopes@sapo.pt>2012-06-28 00:59:33 +0000
commit532516a87bc57f21e6d99f49548e4c2adf835551 (patch)
treeeb4dd8852caf33c4c01be6f44c463e6c4adbf7d3 /lib/Support/ConstantRange.cpp
parent58a6cf2c620ce4c127b926408d78aa607a373251 (diff)
downloadllvm-532516a87bc57f21e6d99f49548e4c2adf835551.tar.gz
llvm-532516a87bc57f21e6d99f49548e4c2adf835551.tar.bz2
llvm-532516a87bc57f21e6d99f49548e4c2adf835551.tar.xz
fix a off-by-one bug in intersectWith(), and add a bunch of tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159319 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Support/ConstantRange.cpp')
-rw-r--r--lib/Support/ConstantRange.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Support/ConstantRange.cpp b/lib/Support/ConstantRange.cpp
index e7d8483128..61d333f24a 100644
--- a/lib/Support/ConstantRange.cpp
+++ b/lib/Support/ConstantRange.cpp
@@ -316,7 +316,7 @@ ConstantRange ConstantRange::intersectWith(const ConstantRange &CR) const {
return CR;
}
- if (CR.Upper.ult(Lower)) {
+ if (CR.Upper.ule(Lower)) {
if (CR.Lower.ult(Lower))
return *this;