Skip to content

Commit fba771b

Browse files
committed
assume md may be malformed
1 parent ff6ee73 commit fba771b

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

llvm/lib/IR/Verifier.cpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5487,12 +5487,13 @@ void Verifier::visitInstruction(Instruction &I) {
54875487
CheckDI(isa<DILocation>(N), "invalid !dbg metadata attachment", &I, N);
54885488
visitMDNode(*N, AreDebugLocsAllowed::Yes);
54895489

5490-
auto *DL = cast<DILocation>(N);
5491-
if (DL->getAtomGroup())
5492-
CheckDI(DL->getScope()->getSubprogram()->getKeyInstructionsEnabled(),
5493-
"DbgLoc uses atomGroup but DISubprogram doesn't have Key "
5494-
"Instructions enabled",
5495-
DL, DL->getScope()->getSubprogram());
5490+
if (auto *DL = dyn_cast<DILocation>(N)) {
5491+
if (DL->getAtomGroup())
5492+
CheckDI(DL->getScope()->getSubprogram()->getKeyInstructionsEnabled(),
5493+
"DbgLoc uses atomGroup but DISubprogram doesn't have Key "
5494+
"Instructions enabled",
5495+
DL, DL->getScope()->getSubprogram());
5496+
}
54965497
}
54975498

54985499
if (auto *DII = dyn_cast<DbgVariableIntrinsic>(&I)) {

0 commit comments

Comments
 (0)