[MemorySSA] Turn an assert into a condition
authorGeorge Burgess IV <george.burgess.iv@gmail.com>
Thu, 29 Mar 2018 03:12:03 +0000 (03:12 +0000)
committerGeorge Burgess IV <george.burgess.iv@gmail.com>
Thu, 29 Mar 2018 03:12:03 +0000 (03:12 +0000)
Eli pointed out that variadic functions are totally a thing, so this
assert is incorrect.

No test-case is provided, since the only way this assert fires is if a
specific DenseMap falls back to doing `isEqual` checks, and that seems
fairly brittle (and requires a pyramid of growing
`call void (i8, ...) @varargs(i8 0)`).

llvm-svn: 328755

llvm/lib/Analysis/MemorySSA.cpp

index e67d957..c8fef6a 100644 (file)
@@ -159,8 +159,8 @@ public:
     if (CS.getCalledValue() != Other.CS.getCalledValue())
       return false;
 
-    assert(CS.arg_size() == Other.CS.arg_size());
-    return std::equal(CS.arg_begin(), CS.arg_end(), Other.CS.arg_begin());
+    return CS.arg_size() == Other.CS.arg_size() &&
+           std::equal(CS.arg_begin(), CS.arg_end(), Other.CS.arg_begin());
   }
 
 private: