From: Chris Lattner Date: Fri, 29 Jun 2001 05:25:51 +0000 (+0000) Subject: Add a check to avoid allowing V->replaceAllUsesWith(V) X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=7b8ec2d752c07df070479ba235b8b1147d009f0f;p=oota-llvm.git Add a check to avoid allowing V->replaceAllUsesWith(V) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/VMCore/Value.cpp b/lib/VMCore/Value.cpp index 79d8e0a4620..fa3c0f60fb4 100644 --- a/lib/VMCore/Value.cpp +++ b/lib/VMCore/Value.cpp @@ -43,6 +43,7 @@ Value::~Value() { void Value::replaceAllUsesWith(Value *D) { assert(D && "Value::replaceAllUsesWith() is invalid!"); + assert(D != this && "V->replaceAllUsesWith(V) is NOT valid!"); while (!Uses.empty()) { User *Use = Uses.front(); #ifndef NDEBUG