mirror of
https://github.com/RPCSX/llvm.git
synced 2025-02-13 09:14:38 +00:00
Fix an off-by-one bug in computing the index of the word to clear.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34326 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
9d1597b086
commit
f1f007d2ff
@ -292,7 +292,10 @@ private:
|
||||
void clear_unused_bits() {
|
||||
if (Size) {
|
||||
unsigned ExtraBits = Size % BITS_PER_WORD;
|
||||
Bits[Size / BITS_PER_WORD] &= ~(~0 << ExtraBits);
|
||||
unsigned index = Size / BITS_PER_WORD;
|
||||
if (Size % BITS_PER_WORD == 0)
|
||||
index--;
|
||||
Bits[index] &= ~(~0 << ExtraBits);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user