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 | c86e67e11026e23d634f65d31cc8ca762d4fa9c3 (patch) | |
| tree | 888d4a8299bf44527d15cc7778e7fe28c97e2e70 /llvm/lib/Analysis/ValueTracking.cpp | |
| parent | 820ba7ba43a25a9caefb3bf1f9049d1d73935fdb (diff) | |
| download | llvm-c86e67e11026e23d634f65d31cc8ca762d4fa9c3.zip llvm-c86e67e11026e23d634f65d31cc8ca762d4fa9c3.tar.gz llvm-c86e67e11026e23d634f65d31cc8ca762d4fa9c3.tar.bz2 | |
fix an off-by-one bug that caused a crash analyzing
ashr's with huge shift amounts, PR8896
llvm-svn: 122814
Diffstat (limited to 'llvm/lib/Analysis/ValueTracking.cpp')
| -rw-r--r-- | llvm/lib/Analysis/ValueTracking.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Analysis/ValueTracking.cpp b/llvm/lib/Analysis/ValueTracking.cpp index 6f58afe..e2d7e92 100644 --- a/llvm/lib/Analysis/ValueTracking.cpp +++ b/llvm/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)); |
