diff --git a/lib/VMCore/Value.cpp b/lib/VMCore/Value.cpp index c4327a1814d..6c01f65e4e4 100644 --- a/lib/VMCore/Value.cpp +++ b/lib/VMCore/Value.cpp @@ -50,6 +50,8 @@ Value::~Value() { void Value::replaceAllUsesWith(Value *D) { assert(D && "Value::replaceAllUsesWith() is invalid!"); assert(D != this && "V->replaceAllUsesWith(V) is NOT valid!"); + assert(D->getType() == getType() && + "replaceAllUses of value with new value of different type!"); while (!Uses.empty()) { User *Use = Uses.back(); #ifndef NDEBUG