]> granicus.if.org Git - llvm/commitdiff
Merging r328755:
authorTom Stellard <tstellar@redhat.com>
Tue, 10 Apr 2018 04:35:05 +0000 (04:35 +0000)
committerTom Stellard <tstellar@redhat.com>
Tue, 10 Apr 2018 04:35:05 +0000 (04:35 +0000)
------------------------------------------------------------------------
r328755 | gbiv | 2018-03-28 20:12:03 -0700 (Wed, 28 Mar 2018) | 10 lines

[MemorySSA] Turn an assert into a condition

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)`).

------------------------------------------------------------------------

git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_60@329670 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/MemorySSA.cpp

index 137b2022e84b3ee90716eab5621d5bb7a0f75f4a..09605f61fa9356cdedb9238489c82f85df6e3309 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: