Skip to content

Commit 031ed87

Browse files
committed
SILPrinter: be more tolerant if an instruction is not contained in a parent block.
1 parent cceb2a4 commit 031ed87

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/SIL/IR/SILPrinter.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3532,6 +3532,9 @@ ID SILPrintContext::getID(const SILNode *node) {
35323532
return {ID::SILUndef, 0};
35333533

35343534
SILBasicBlock *BB = node->getParentBlock();
3535+
if (!BB) {
3536+
return { ID::Null, 0 };
3537+
}
35353538
if (SILFunction *F = BB->getParent()) {
35363539
setContext(F);
35373540
// Lazily initialize the instruction -> ID mapping.

0 commit comments

Comments
 (0)