mirror of
https://github.com/github/codeql.git
synced 2025-12-17 17:23:36 +01:00
Will need subsequent PRs fixing up test failures (due to deprecated methods moving around), but other than that everything should be straight-forward.
20 lines
527 B
Plaintext
20 lines
527 B
Plaintext
import python
|
|
|
|
predicate can_reach_from_entry_without_passing(ControlFlowNode target, ControlFlowNode pass) {
|
|
target != pass and
|
|
target.getScope() = pass.getScope() and
|
|
(
|
|
target.isEntryNode()
|
|
or
|
|
exists(ControlFlowNode pre |
|
|
target.getAPredecessor() = pre and can_reach_from_entry_without_passing(pre, pass)
|
|
)
|
|
)
|
|
}
|
|
|
|
from ControlFlowNode node, ControlFlowNode dom
|
|
where
|
|
dom = node.getImmediateDominator() and
|
|
can_reach_from_entry_without_passing(node, dom)
|
|
select node.toString(), dom.toString()
|