From 532516a87bc57f21e6d99f49548e4c2adf835551 Mon Sep 17 00:00:00 2001 From: Nuno Lopes Date: Thu, 28 Jun 2012 00:59:33 +0000 Subject: 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 --- lib/Support/ConstantRange.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/Support/ConstantRange.cpp') 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; -- cgit v1.2.3