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
This commit is contained in:
Chris Lattner 2001-06-29 05:25:51 +00:00
parent b47af25099
commit 7b8ec2d752

View File

@ -43,6 +43,7 @@ Value::~Value() {
void Value::replaceAllUsesWith(Value *D) {
assert(D && "Value::replaceAllUsesWith(<null>) is invalid!");
assert(D != this && "V->replaceAllUsesWith(V) is NOT valid!");
while (!Uses.empty()) {
User *Use = Uses.front();
#ifndef NDEBUG