From 5edc4592204d4d4ba85f59ecc607ef45db4ae416 Mon Sep 17 00:00:00 2001 From: Nick Lewycky Date: Mon, 13 Jul 2009 04:17:23 +0000 Subject: 'i8 full-range' sign extended to i16 should equal [-128, 128) not [-128, 127). Found by Daniel Dunbar and KLEE. llvm-svn: 75448 --- llvm/lib/Support/ConstantRange.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'llvm/lib/Support/ConstantRange.cpp') diff --git a/llvm/lib/Support/ConstantRange.cpp b/llvm/lib/Support/ConstantRange.cpp index d7a57bb134c..ca25491f623 100644 --- a/llvm/lib/Support/ConstantRange.cpp +++ b/llvm/lib/Support/ConstantRange.cpp @@ -505,7 +505,7 @@ ConstantRange ConstantRange::signExtend(uint32_t DstTySize) const { assert(SrcTySize < DstTySize && "Not a value extension"); if (isFullSet()) { return ConstantRange(APInt::getHighBitsSet(DstTySize,DstTySize-SrcTySize+1), - APInt::getLowBitsSet(DstTySize, SrcTySize-1)); + APInt::getLowBitsSet(DstTySize, SrcTySize-1) + 1); } APInt L = Lower; L.sext(DstTySize); -- cgit v1.2.3