forked from OSchip/llvm-project
Proper fix for the off-by-one bug in clear_unused_bits().
llvm-svn: 34328
This commit is contained in:
parent
9a3e3222e9
commit
8307918cc8
|
@ -290,12 +290,10 @@ private:
|
|||
|
||||
// Clear the unused top bits in the high word.
|
||||
void clear_unused_bits() {
|
||||
if (Size) {
|
||||
unsigned ExtraBits = Size % BITS_PER_WORD;
|
||||
unsigned ExtraBits = Size % BITS_PER_WORD;
|
||||
if (ExtraBits) {
|
||||
unsigned index = Size / BITS_PER_WORD;
|
||||
if (Size % BITS_PER_WORD == 0)
|
||||
index--;
|
||||
Bits[index] &= ~(~0 << ExtraBits);
|
||||
Bits[index] &= ~(~0L << ExtraBits);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue