summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--llvm/lib/IR/Verifier.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/IR/Verifier.cpp b/llvm/lib/IR/Verifier.cpp
index f64ebc1a672..f49cca5a3e3 100644
--- a/llvm/lib/IR/Verifier.cpp
+++ b/llvm/lib/IR/Verifier.cpp
@@ -1974,9 +1974,10 @@ void Verifier::visitInstruction(Instruction &I) {
Assert1(BB, "Instruction not embedded in basic block!", &I);
if (!isa<PHINode>(I)) { // Check that non-phi nodes are not self referential
- for (User *U : I.users())
+ for (User *U : I.users()) {
Assert1(U != (User*)&I || !DT.isReachableFromEntry(BB),
"Only PHI nodes may reference their own value!", &I);
+ }
}
// Check that void typed values don't have names
OpenPOWER on IntegriCloud