aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Support/ConstantRange.cpp
diff options
context:
space:
mode:
authorNick Lewycky <nicholas@mxc.ca>2009-07-13 04:17:23 +0000
committerNick Lewycky <nicholas@mxc.ca>2009-07-13 04:17:23 +0000
commitff84de767a9baded740abd1e846938477a4b285a (patch)
treeac55837ffd97afa396f19f7ac992b70e0e0167bd /lib/Support/ConstantRange.cpp
parent0a5372ed3e8cda10d724feda3c1a1c998db05ca0 (diff)
downloadexternal_llvm-ff84de767a9baded740abd1e846938477a4b285a.zip
external_llvm-ff84de767a9baded740abd1e846938477a4b285a.tar.gz
external_llvm-ff84de767a9baded740abd1e846938477a4b285a.tar.bz2
'i8 full-range' sign extended to i16 should equal [-128, 128) not [-128, 127).
Found by Daniel Dunbar and KLEE. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75448 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 d7a57bb..ca25491 100644
--- a/lib/Support/ConstantRange.cpp
+++ b/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);