CodeQL library for Go
codeql/go-all 0.7.13 (changelog, source)
Search

Module ControlFlow

Provides helper predicates for mapping btween CFG nodes and the AST.

Import path

import semmle.go.controlflow.ControlFlowGraph

Predicates

entryNode

Gets the entry node of function or file root.

exitNode

Gets the exit node of function or file root.

isSwitchCaseTestPassingEdge

Holds if pred is the node for the case testExpr in an expression switch statement which is switching on switchExpr, and succ is the node to be executed next if the case test succeeds.

mayReturnNormally

Holds if the function f may return without panicking, exiting the process, or looping forever.

Classes

ConditionGuardNode

A control-flow node recording the fact that a certain expression has a known Boolean value at this point in the program.

Node

A node in the intra-procedural control-flow graph of a Go function or file.

Root

A file or function with which a CFG is associated.

WriteNode

A control-flow node that initializes or updates the value of a constant, a variable, a field, or an (array, slice, or map) element.