aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/VMCore/Verifier.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/VMCore/Verifier.cpp b/lib/VMCore/Verifier.cpp
index ffe2c5a548..edd3da1a00 100644
--- a/lib/VMCore/Verifier.cpp
+++ b/lib/VMCore/Verifier.cpp
@@ -559,6 +559,12 @@ void Verifier::visitInstruction(Instruction &I) {
// exceptional destination.
if (InvokeInst *II = dyn_cast<InvokeInst>(Op))
OpBlock = II->getNormalDest();
+ else if (OpBlock == BB) {
+ // If they are in the same basic block, make sure that the definition
+ // comes before the use.
+ Assert2(DS->dominates(Op, &I),
+ "Instruction does not dominate all uses!", Op, &I);
+ }
// Definition must dominate use unless use is unreachable!
Assert2(DS->dominates(OpBlock, BB) ||