mirror of
https://github.com/github/codeql.git
synced 2025-12-18 01:33:15 +01:00
CPP: Have reachability flow to the Handler as well as the CAtchBlock of an exception.
This commit is contained in:
@@ -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())
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user