mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-31 12:41:49 +01:00
[AArch64] Fix UB about shift amount exceeds data bit-width
Summary: Fixes an UB caught by sanitizer. The shift amount might be larger than 32 so the operand should be 1ULL. In this patch, we replace the original expression with existing API with uint64_t type. Reviewers: eli.friedman, rengolin Reviewed By: rengolin Subscribers: rengolin, javed.absar, llvm-commits, kristof.beyls Differential Revision: https://reviews.llvm.org/D44234 llvm-svn: 326969
This commit is contained in:
parent
aea705310a
commit
f016668754
@ -1512,7 +1512,7 @@ static bool isBitfieldExtractOpFromAnd(SelectionDAG *CurDAG, SDNode *N,
|
||||
|
||||
// Because of simplify-demanded-bits in DAGCombine, the mask may have been
|
||||
// simplified. Try to undo that
|
||||
AndImm |= (1 << NumberOfIgnoredLowBits) - 1;
|
||||
AndImm |= maskTrailingOnes<uint64_t>(NumberOfIgnoredLowBits);
|
||||
|
||||
// The immediate is a mask of the low bits iff imm & (imm+1) == 0
|
||||
if (AndImm & (AndImm + 1))
|
||||
|
Loading…
x
Reference in New Issue
Block a user