[llvm-commits] [llvm] r38481 - /llvm/trunk/include/llvm/ADT/BitVector.h

Owen Anderson resistor at mac.com
Mon Jul 9 19:01:16 PDT 2007


Author: resistor
Date: Mon Jul  9 21:01:16 2007
New Revision: 38481

URL: http://llvm.org/viewvc/llvm-project?rev=38481&view=rev
Log:
Evidently my earlier fix did not go far enough.  When resizing a zero-sized
BitVector, make sure to set or clear ALL of the bits.

Modified:
    llvm/trunk/include/llvm/ADT/BitVector.h

Modified: llvm/trunk/include/llvm/ADT/BitVector.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/BitVector.h?rev=38481&r1=38480&r2=38481&view=diff

==============================================================================
--- llvm/trunk/include/llvm/ADT/BitVector.h (original)
+++ llvm/trunk/include/llvm/ADT/BitVector.h Mon Jul  9 21:01:16 2007
@@ -188,7 +188,8 @@
     
     // If we previously had no size, initialize the low word
     if (Size == 0)
-      Bits[0] = t;
+      for (unsigned i = 0; i < Capacity; ++i)
+        Bits[i] = 0 - (unsigned)t;
     
     Size = N;
     clear_unused_bits();





More information about the llvm-commits mailing list