Skip to content

Commit 771d7d7

Browse files
committed
[clang][dataflow] HTMLLogger: Don't crash if CFG contains unreachable blocks.
Reviewed By: sammccall Differential Revision: https://reviews.llvm.org/D156411
1 parent 95e5a46 commit 771d7d7

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

clang/lib/Analysis/FlowSensitive/HTMLLogger.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -462,8 +462,9 @@ class HTMLLogger : public Logger {
462462
GraphS << " " << blockID(I) << " [id=" << blockID(I) << "]\n";
463463
for (const auto *Block : CFG) {
464464
for (const auto &Succ : Block->succs()) {
465-
GraphS << " " << blockID(Block->getBlockID()) << " -> "
466-
<< blockID(Succ.getReachableBlock()->getBlockID()) << "\n";
465+
if (Succ.getReachableBlock())
466+
GraphS << " " << blockID(Block->getBlockID()) << " -> "
467+
<< blockID(Succ.getReachableBlock()->getBlockID()) << "\n";
467468
}
468469
}
469470
GraphS << "}\n";

0 commit comments

Comments
 (0)