CPP: Have reachability flow to the Handler as well as the CAtchBlock of an exception.

This commit is contained in:
Geoffrey White
2018-10-30 13:03:43 +00:00
parent 6e940d7bf2
commit 1092cb97e5
2 changed files with 8 additions and 8 deletions

View File

@@ -245,8 +245,14 @@ class BasicBlock extends ControlFlowNodeBase {
predicate isReachable() {
exists(Function f | f.getBlock() = this)
or
exists(TryStmt t, BasicBlock tryblock | this = t.getACatchClause() and tryblock.isReachable() and tryblock.contains(t))
or
exists(TryStmt t, BasicBlock tryblock |
(
this = t.getACatchClause() or
this.(Handler).getTryStmt() = t
) and
tryblock.isReachable() and
tryblock.contains(t)
) or
exists(BasicBlock pred | pred.getASuccessor() = this and pred.isReachable())
}