Clean up static analyzer warnings.
[oota-llvm.git] / include / llvm / ADT / BitVector.h
index 34e2284311b39e7049ff33ac2c698056505e4b88..bedb47147cb0d4960df555055e6c4d814231b89a 100644 (file)
@@ -450,6 +450,7 @@ public:
 
     // Grow the bitvector to have enough elements.
     Capacity = RHSWords;
+    assert(Capacity > 0 && "negative capacity?");
     BitWord *NewBits = (BitWord *)std::malloc(Capacity * sizeof(BitWord));
     std::memcpy(NewBits, RHS.Bits, Capacity * sizeof(BitWord));