From 0c81450a0c1f859738a2f209a89de10f889fcd84 Mon Sep 17 00:00:00 2001 From: Owen Anderson Date: Mon, 9 Jul 2007 23:39:39 +0000 Subject: [PATCH] When resizing a BitVector with size 0, be sure to clear the low word before using it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@38476 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/ADT/BitVector.h | 5 +++++ 1 file changed, 5 insertions(+) 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(); } -- 2.34.1