When resizing a BitVector with size 0, be sure to clear the low word before using it.

llvm-svn: 38476
This commit is contained in:
Owen Anderson 2007-07-09 23:39:39 +00:00
parent effc7a7d16
commit c3bd1db42d
1 changed files with 5 additions and 0 deletions

View File

@ -185,6 +185,11 @@ public:
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();
}