[llvm-commits] [llvm] r38476 - /llvm/trunk/include/llvm/ADT/BitVector.h
Owen Anderson
resistor at mac.com
Mon Jul 9 16:39:40 PDT 2007
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();
}
More information about the llvm-commits
mailing list