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

Module CfgNodes

Provides subclasses of CfgNode that represents different types of nodes in the control flow graph.

Import path

import codeql.rust.controlflow.CfgNodes

Imports

Nodes

Provides sub classes of CfgNode.

Classes

AssignmentExprCfgNode

An assignment expression, for example

BlockExprCfgNode

A block expression. For example: rust { let x = 42; } rust 'label: { let x = 42; x }

BreakExprCfgNode

A break expression. For example: rust loop { if not_ready() { break; } } rust let x = 'label: loop { if done() { break 'label 42; } }; rust let x = 'label: { if exit() { break 'label 42; } 0; };

CallCfgNode

A CFG node that calls a function.

CallExprCfgNode

An expression with parenthesized arguments. For example: rust foo(42); foo::<u32, u64>(42); foo[0](42); foo(1) = 4; Option::Some(42);

CompoundAssignmentExprCfgNode

A compound assignment expression, for example: rust x += y;

FormatArgsExprCfgNode

A FormatArgsExpr. For example: rust format_args!("no args"); format_args!("{} foo {:?}", 1, 2); format_args!("{b} foo {a:?}", a=1, b=2); let (x, y) = (1, 42); format_args!("{x}, {y}");

MacroCallCfgNode

A MacroCall. For example: rust todo!()

MatchExprCfgNode

A match expression. For example: rust match x { Option::Some(y) => y, Option::None => 0, } rust match x { Some(y) if y != 0 => 1 / y, _ => 0, }

MethodCallExprCfgNode

A method call expression. For example: rust x.foo(42); x.foo::<u32, u64>(42);

StructExprCfgNode

A record expression. For example: rust let first = Foo { a: 1, b: 2 }; let second = Foo { a: 2, ..first }; Foo { a: 1, b: 2 }[2] = 10; Foo { .. } = second;

StructPatCfgNode

A record pattern. For example: rust match x { Foo { a: 1, b: 2 } => "ok", Foo { .. } => "fail", }

VariableAccessCfgNode

A variable access.

VariableReadAccessCfgNode

A variable read.

VariableWriteAccessCfgNode

A variable write.

Aliases

AnnotatedExitCfgNode

An exit node for a given scope, annotated with the type of exit.

AstCfgNode

A node for an AST node.

ExitCfgNode

An exit node for a given scope.