From: Owen Anderson Date: Mon, 9 Jul 2007 23:39:39 +0000 (+0000) Subject: When resizing a BitVector with size 0, be sure to clear the low word before using it. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=0c81450a0c1f859738a2f209a89de10f889fcd84;p=oota-llvm.git 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 --- 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(); }