aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/VMCore/Value.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/VMCore/Value.cpp b/lib/VMCore/Value.cpp
index c4327a1814..6c01f65e4e 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(<null>) 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