Add a check to avoid allowing V->replaceAllUsesWith(V)
llvm-svn: 104
This commit is contained in:
parent
615d3cf40d
commit
2dd58aefa5
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue