Module DataFlowUtil

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

Import path

import semmle.code.cpp.ir.dataflow.internal.DataFlowUtil

Predicates

convertedExprNode

Gets the Node corresponding to e, if any. Here, e may be a Conversion.

definitionByReferenceNode

Gets the Node corresponding to a definition by reference of the variable that is passed as argument of a call.

exprNode

Gets a Node corresponding to e or any of its conversions. There is no result if e is a Conversion.

getArgumentPosOfSideEffect

INTERNAL: do not use. Translates a parameter/argument index into a negative number that denotes the index of its side effect (pointer indirection).

getSideEffectFor

Holds if the result is a side effect for instruction call on argument index argument. This helper predicate makes it easy to join on both of these columns at once, avoiding pathological join orders in case the argument index should get joined first.

instructionNode

Gets the node corresponding to instr.

localExprFlow

Holds if data can flow from e1 to e2 in zero or more local (intra-procedural) steps.

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.

localInstructionFlow

Holds if data can flow from i1 to i2 in zero or more local (intra-procedural) steps.

parameterNode

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

simpleLocalFlowStep

INTERNAL: do not use.

uninitializedNode

DEPRECATED: See UninitializedNode.

variableNode

Gets the VariableNode corresponding to the variable v.

Classes

BarrierGuard

A guard that validates some instruction.

DefinitionByReferenceNode

A node that represents the value of a variable after a function call that may have changed the variable because it’s passed by reference.

ExprNode

An expression, viewed as a node in a data flow graph.

InstructionNode

An instruction, viewed as a node in a data flow graph.

Node

A node in a data flow graph.

OperandNode

An operand, viewed as a node in a data flow graph.

ParameterIndirectionNode

A synthetic parameter to model the pointed-to object of a pointer parameter.

ParameterNode

The value of a parameter at function entry, viewed as a node in a data flow graph. This includes both explicit parameters such as x in f(x) and implicit parameters such as this in x.f().

PostUpdateNode

A node associated with an object after an operation that might have changed its state.

ThisParameterNode

An implicit this parameter.

UninitializedNode

DEPRECATED: Data flow was never an accurate way to determine what expressions might be uninitialized. It errs on the side of saying that everything is uninitialized, and this is even worse in the IR because the IR doesn’t use syntactic hints to rule out variables that are definitely initialized.

VariableNode

A Node corresponding to a variable in the program, as opposed to the value of that variable at some particular point. This can be used for modeling flow in and out of global variables.