diff --git a/include/llvm/ADT/BitVector.h b/include/llvm/ADT/BitVector.h index 6418f7f66b4..5247756618e 100644 --- a/include/llvm/ADT/BitVector.h +++ b/include/llvm/ADT/BitVector.h @@ -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(); }