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

Module DataFlowUtil

Provides Go-specific definitions for use in the data flow library.

Import path

import semmle.go.dataflow.internal.DataFlowUtil

Imports

Public

Nodes intended for use outside the data-flow libraries.

Predicates

exprNode

Gets the Node corresponding to e.

extractTupleElement

Gets the data-flow node corresponding to the ith element of tuple t (which is either a call with multiple results, an iterator in a range loop, or the result of a type assertion).

getUniqueOutputNode
instructionNode

Gets the Node corresponding to insn.

isReturnedWithError

Holds if node refers to a value returned alongside a non-nil error value.

localFlow

Holds if data flows from source to sink in zero or more local (intra-procedural) steps.

localFlowStep

Holds if data flows from nodeFrom to nodeTo in exactly one local (intra-procedural) step.

parameterNode

Gets the Node corresponding to the value of p at function entry.

possiblyReturnsBool

Holds if ret is a data-flow node whose value contributes to the output res of fd, and that node may have Boolean value b.

possiblyReturnsNonNil

Holds if ret is a data-flow node whose value contributes to the output res of fd, and that node may evaluate to a value other than nil.

readsAnElement

Holds if node reads an element from base, either via an element-read (base[y]) expression or via a range statement _, node := range base.

receiverNode

Gets the Node corresponding to the value of r at function entry.

simpleLocalFlowStep

INTERNAL: do not use.

ssaNode

Gets the data-flow node corresponding to SSA variable v.

Classes

ArrayContent

A reference through an array.

CollectionContent

A reference through the contents of some collection-like container.

Content

A reference contained in an object. Examples include instance fields, the contents of a collection object, the contents of an array or pointer.

ContentSet

An entity that represents a set of Contents.

FieldContent

A reference through a field.

FunctionModel

A model of a function specifying that the function copies input values from a parameter or qualifier to a result.

MapKeyContent

A reference through a map key.

MapValueContent

A reference through a map value.

PointerContent

A reference through a pointer.

SyntheticFieldContent

Modules

BarrierGuard

Provides a set of barrier nodes for a guard that validates an expression.

Predicate signatures

guardChecksSig

Holds if the guard g validates the expression e upon evaluating to branch.