diff --git a/clang/lib/Analysis/FlowSensitive/HTMLLogger.cpp b/clang/lib/Analysis/FlowSensitive/HTMLLogger.cpp
--- a/clang/lib/Analysis/FlowSensitive/HTMLLogger.cpp
+++ b/clang/lib/Analysis/FlowSensitive/HTMLLogger.cpp
@@ -458,8 +458,9 @@
GraphS << " " << blockID(I) << " [id=" << blockID(I) << "]\n";
for (const auto *Block : CFG) {
for (const auto &Succ : Block->succs()) {
- GraphS << " " << blockID(Block->getBlockID()) << " -> "
- << blockID(Succ.getReachableBlock()->getBlockID()) << "\n";
+ if (Succ.getReachableBlock())
+ GraphS << " " << blockID(Block->getBlockID()) << " -> "
+ << blockID(Succ.getReachableBlock()->getBlockID()) << "\n";
}
}
GraphS << "}\n";