summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR/Verifier.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/IR/Verifier.cpp')
-rw-r--r--llvm/lib/IR/Verifier.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/IR/Verifier.cpp b/llvm/lib/IR/Verifier.cpp
index ce765b14420..4f0e3388d58 100644
--- a/llvm/lib/IR/Verifier.cpp
+++ b/llvm/lib/IR/Verifier.cpp
@@ -2556,6 +2556,13 @@ void Verifier::visitInstruction(Instruction &I) {
&I);
}
+ // Don't recurse into !dbg attachments (leave that for verifyDebugInfo()),
+ // but at least check that it's a legal type.
+ if (MDNode *N = I.getDebugLoc().getAsMDNode()) {
+ Assert(isa<MDLocation>(N),
+ "invalid !dbg metadata attachment", &I, N);
+ }
+
InstsInThisBlock.insert(&I);
}
OpenPOWER on IntegriCloud