operator== returns false when two bitvectors have different sizes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34317 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Evan Cheng 2007-02-15 19:16:21 +00:00
parent c761df18ae
commit 638417f788

View File

@ -235,7 +235,9 @@ public:
// Comparison operators.
bool operator==(const BitVector &RHS) const {
assert(Size == RHS.Size && "Illegal operation!");
if (Size != RHS.Size)
return false;
for (unsigned i = 0; i < NumBitWords(size()); ++i)
if (Bits[i] != RHS.Bits[i])
return false;