From 7b8ec2d752c07df070479ba235b8b1147d009f0f Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Fri, 29 Jun 2001 05:25:51 +0000 Subject: [PATCH] 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 --- lib/VMCore/Value.cpp | 1 + 1 file changed, 1 insertion(+) 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 -- 2.34.1