aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/llvm/ADT/BitVector.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/llvm/ADT/BitVector.h b/include/llvm/ADT/BitVector.h
index 6418f7f66b..5247756618 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();
}