mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-26 04:32:44 +01:00
Add a check to avoid allowing V->replaceAllUsesWith(V)
llvm-svn: 104
This commit is contained in:
parent
09a1ba491b
commit
806b7ff4be
@ -43,6 +43,7 @@ Value::~Value() {
|
|||||||
|
|
||||||
void Value::replaceAllUsesWith(Value *D) {
|
void Value::replaceAllUsesWith(Value *D) {
|
||||||
assert(D && "Value::replaceAllUsesWith(<null>) is invalid!");
|
assert(D && "Value::replaceAllUsesWith(<null>) is invalid!");
|
||||||
|
assert(D != this && "V->replaceAllUsesWith(V) is NOT valid!");
|
||||||
while (!Uses.empty()) {
|
while (!Uses.empty()) {
|
||||||
User *Use = Uses.front();
|
User *Use = Uses.front();
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
|
Loading…
Reference in New Issue
Block a user