mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-27 14:34:58 +00:00
Bounds-check APInt's operator[].
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119708 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
409d64a764
commit
078d967e0a
@ -483,6 +483,7 @@ APInt APInt::operator-(const APInt& RHS) const {
|
||||
}
|
||||
|
||||
bool APInt::operator[](unsigned bitPosition) const {
|
||||
assert(bitPosition < getBitWidth() && "Bit position out of bounds!");
|
||||
return (maskBit(bitPosition) &
|
||||
(isSingleWord() ? VAL : pVal[whichWord(bitPosition)])) != 0;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user