From: Chris Lattner Date: Thu, 21 Mar 2002 05:38:15 +0000 (+0000) Subject: Add an assertion to catch a misuse of replaceAllUsesWith X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=150dcb9e2d290c95f40ba9616863b77ff8511df6;p=oota-llvm.git 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 --- 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