aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2002-03-21 05:38:15 +0000
committerChris Lattner <sabre@nondot.org>2002-03-21 05:38:15 +0000
commit150dcb9e2d290c95f40ba9616863b77ff8511df6 (patch)
tree326622ee3b113118e0677a625285623f5cea0109
parent60091fa6b1bf5199a5538c27f0aadef75547f715 (diff)
Add an assertion to catch a misuse of replaceAllUsesWith
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1924 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/VMCore/Value.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/VMCore/Value.cpp b/lib/VMCore/Value.cpp
index c4327a1814..6c01f65e4e 100644
--- a/lib/VMCore/Value.cpp
+++ b/lib/VMCore/Value.cpp
@@ -50,6 +50,8 @@ Value::~Value() {
void Value::replaceAllUsesWith(Value *D) {
assert(D && "Value::replaceAllUsesWith(<null>) is invalid!");
assert(D != this && "V->replaceAllUsesWith(V) is NOT valid!");
+ assert(D->getType() == getType() &&
+ "replaceAllUses of value with new value of different type!");
while (!Uses.empty()) {
User *Use = Uses.back();
#ifndef NDEBUG