Changes in directory llvm/include/llvm/ADT:
BitVector.h updated: 1.14 -> 1.15 --- Log message: Fix an off-by-one bug in computing the index of the word to clear. --- Diffs of the changes: (+4 -1) BitVector.h | 5 ++++- 1 files changed, 4 insertions(+), 1 deletion(-) Index: llvm/include/llvm/ADT/BitVector.h diff -u llvm/include/llvm/ADT/BitVector.h:1.14 llvm/include/llvm/ADT/BitVector.h:1.15 --- llvm/include/llvm/ADT/BitVector.h:1.14 Thu Feb 15 14:14:06 2007 +++ llvm/include/llvm/ADT/BitVector.h Thu Feb 15 14:49:10 2007 @@ -292,7 +292,10 @@ 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); } } _______________________________________________ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits