diff options
author | Chris Lattner <sabre@nondot.org> | 2011-01-04 18:19:15 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2011-01-04 18:19:15 +0000 |
commit | 43b40a4620c155c73ac71b48472ea2411d7c35da (patch) | |
tree | 2a91e31af838065b7c2a32dd1ad73b215b810faa /lib/Analysis/ValueTracking.cpp | |
parent | ba64b9706a1f83e8388c3c722953de16d102de27 (diff) |
fix an off-by-one bug that caused a crash analyzing
ashr's with huge shift amounts, PR8896
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122814 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/ValueTracking.cpp')
-rw-r--r-- | lib/Analysis/ValueTracking.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Analysis/ValueTracking.cpp b/lib/Analysis/ValueTracking.cpp index 6f58afe527..e2d7e9290a 100644 --- a/lib/Analysis/ValueTracking.cpp +++ b/lib/Analysis/ValueTracking.cpp @@ -337,7 +337,7 @@ void llvm::ComputeMaskedBits(Value *V, const APInt &Mask, // (ashr X, C1) & C2 == 0 iff (-1 >> C1) & C2 == 0 if (ConstantInt *SA = dyn_cast<ConstantInt>(I->getOperand(1))) { // Compute the new bits that are at the top now. - uint64_t ShiftAmt = SA->getLimitedValue(BitWidth); + uint64_t ShiftAmt = SA->getLimitedValue(BitWidth-1); // Signed shift right. APInt Mask2(Mask.shl(ShiftAmt)); |