Changes in directory llvm/include/llvm/ADT:
BitVector.h updated: 1.15 -> 1.16 --- Log message: Proper fix for the off-by-one bug in clear_unused_bits(). --- Diffs of the changes: (+3 -5) BitVector.h | 8 +++----- 1 files changed, 3 insertions(+), 5 deletions(-) Index: llvm/include/llvm/ADT/BitVector.h diff -u llvm/include/llvm/ADT/BitVector.h:1.15 llvm/include/llvm/ADT/BitVector.h:1.16 --- llvm/include/llvm/ADT/BitVector.h:1.15 Thu Feb 15 14:49:10 2007 +++ llvm/include/llvm/ADT/BitVector.h Thu Feb 15 15:38:15 2007 @@ -290,12 +290,10 @@ // 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); } } _______________________________________________ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits