CodeQL library for Rust
codeql/rust-all 0.1.11 (changelog, source)
Search

Member predicate Impl::AstNode::getACfgNode

Gets a control flow node for this AST node, if any.

Note that because of control flow splitting, one AstNode node may correspond to multiple CfgNodes. Example:

if a && b {
  // ...
}

The CFG for the condition above looks like

flowchart TD
1["a"]
2["b"]
3["[false] a && b"]
4["[true] a && b"]

1 -- false --> 3
1 -- true --> 2
2 -- false --> 3
2 -- true --> 4

That is, the AST node for a && b corresponds to two CFG nodes (it is split into two).

CfgNode getACfgNode()