From c5c7f755c8c7f12e1d9190aa3a784fb15cb76241 Mon Sep 17 00:00:00 2001 From: Owen Anderson Date: Tue, 10 Jul 2007 02:01:16 +0000 Subject: [PATCH] Evidently my earlier fix did not go far enough. When resizing a zero-sized BitVector, make sure to set or clear ALL of the bits. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@38481 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/ADT/BitVector.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/llvm/ADT/BitVector.h b/include/llvm/ADT/BitVector.h index 5247756618e..243a8102cf8 100644 --- a/include/llvm/ADT/BitVector.h +++ b/include/llvm/ADT/BitVector.h @@ -188,7 +188,8 @@ public: // If we previously had no size, initialize the low word if (Size == 0) - Bits[0] = t; + for (unsigned i = 0; i < Capacity; ++i) + Bits[i] = 0 - (unsigned)t; Size = N; clear_unused_bits(); -- 2.34.1