mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-21 08:17:40 +00:00
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
This commit is contained in:
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user