Author: resistor
Date: Mon Jul  9 18:39:39 2007
New Revision: 38476

URL: http://llvm.org/viewvc/llvm-project?rev=38476&view=rev
Log:
When resizing a BitVector with size 0, be sure to clear the low word before 
using it.

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=38476&r1=38475&r2=38476&view=diff

==============================================================================
--- llvm/trunk/include/llvm/ADT/BitVector.h (original)
+++ llvm/trunk/include/llvm/ADT/BitVector.h Mon Jul  9 18:39:39 2007
@@ -185,6 +185,11 @@
       grow(N);
       init_words(&Bits[OldCapacity], (Capacity-OldCapacity), t);
     }
+    
+    // If we previously had no size, initialize the low word
+    if (Size == 0)
+      Bits[0] = t;
+    
     Size = N;
     clear_unused_bits();
   }


_______________________________________________
llvm-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

Reply via email to