operator== returns false when two bitvectors have different sizes.
authorEvan Cheng <evan.cheng@apple.com>
Thu, 15 Feb 2007 19:16:21 +0000 (19:16 +0000)
committerEvan Cheng <evan.cheng@apple.com>
Thu, 15 Feb 2007 19:16:21 +0000 (19:16 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34317 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/ADT/BitVector.h

index bbbb179ee4d2c65fdceb1939963602311871fe29..0677b5449db46a102ae0cab5728c10b0adab66a4 100644 (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;