From 150dcb9e2d290c95f40ba9616863b77ff8511df6 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Thu, 21 Mar 2002 05:38:15 +0000 Subject: [PATCH] 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 --- lib/VMCore/Value.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/VMCore/Value.cpp b/lib/VMCore/Value.cpp index c4327a1814d..6c01f65e4e4 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() 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