CodeQL library for Python
codeql/python-all 2.1.2-dev (changelog, source)
Search

Class CapturedVariablesArgumentNode

A synthetic argument representing the values of the variables captured by the callable being called. This argument represents a single object where all the values are stored as attributes. This is also known as the environment part of a closure.

This is used for tracking flow through captured variables.

TODO: We might want a synthetic node here, but currently that incurs problems with non-monotonic recursion, because of the use of resolveCall in the char pred. This may be solvable by using CallGraphConstruction::Make in stead of CallGraphConstruction::Simple::Make appropriately.

Import path

import semmle.python.dataflow.new.internal.DataFlowDispatch

Direct supertypes

Indirect supertypes

Fields

Inherited fields

Predicates

argumentOf

Holds if this argument occurs at the given position in the given call.

toString

Gets a textual representation of this element.

Inherited predicates

asCfgNode

Gets the control-flow node corresponding to this node, if any.

from CfgNode
asExpr

Gets the expression corresponding to this node, if any.

from Node
getALocalSource

Gets a local source node from which data may flow to this node in zero or more local data-flow steps.

from Node
getCall

Gets the call in which this node is an argument, if any.

from ArgumentNode
getEnclosingCallable

Gets the enclosing callable of this node.

from Node
getLocation

Gets the location of this node

from CfgNode
getNode

Gets the ControlFlowNode represented by this data-flow node.

from CfgNode
getScope

Gets the scope of this node.

from CfgNode
hasLocationInfo

Holds if this element is at the specified location. The location spans column startcolumn of line startline to column endcolumn of line endline in file filepath. For more information, see Locations.

from Node

Charpred