[PATCH] D156411: [clang][dataflow] HTMLLogger: Don't crash if CFG contains unreachable blocks.
Martin Böhme via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Jul 27 03:14:19 PDT 2023
mboehme created this revision.
Herald added subscribers: martong, xazax.hun.
Herald added a reviewer: NoQ.
Herald added a project: All.
mboehme requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D156411
Files:
clang/lib/Analysis/FlowSensitive/HTMLLogger.cpp
Index: clang/lib/Analysis/FlowSensitive/HTMLLogger.cpp
===================================================================
--- clang/lib/Analysis/FlowSensitive/HTMLLogger.cpp
+++ 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";
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D156411.544680.patch
Type: text/x-patch
Size: 769 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230727/7a2244a1/attachment.bin>
More information about the cfe-commits
mailing list