From 638417f7887303b8dcf75043b39182de4c96db55 Mon Sep 17 00:00:00 2001 From: Evan Cheng Date: Thu, 15 Feb 2007 19:16:21 +0000 Subject: [PATCH] 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 --- include/llvm/ADT/BitVector.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/llvm/ADT/BitVector.h b/include/llvm/ADT/BitVector.h index bbbb179ee4d..0677b5449db 100644 --- a/include/llvm/ADT/BitVector.h +++ b/include/llvm/ADT/BitVector.h @@ -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; -- 2.34.1