CodeQL library for Python
Search

Module Essa

Library for SSA representation (Static Single Assignment form).

Import path

import semmle.python.essa.Essa

Imports

Classes

ArgumentRefinement

A use of a variable as an argument, foo(v), which might modify the object referred to.

AssignmentDefinition

An assignment to a variable v = val

AttributeAssignment

Assignment of an attribute obj.attr = val

CallsiteRefinement

An implicit (possible) definition of an escaping variable at a call-site

DeletionDefinition

A deletion of a variable del v

EssaAttributeDeletion

Deletion of an attribute del obj.attr.

EssaDefinition

Definition of an extended-SSA (ESSA) variable. There is exactly one definition for each variable, and exactly one variable for each definition.

EssaEdgeRefinement

An ESSA definition corresponding to an edge refinement of the underlying variable. For example, the edges leaving a test on a variable both represent refinements of that variable. On one edge the test is true, on the other it is false.

EssaNodeDefinition

A definition of an ESSA variable that is not directly linked to another ESSA variable.

EssaNodeRefinement

A definition of an ESSA variable that takes another ESSA variable as an input.

EssaVariable

An (enhanced) SSA variable derived from SsaSourceVariable.

ExceptionCapture

Capture of a raised exception except ExceptionType ex:

ImplicitSubModuleDefinition

Implicit definition of the names of sub-modules in a package. Although the interpreter does not pre-define these names, merely populating them as they are imported, this is a good approximation for static analysis.

ImportStarRefinement

Possible redefinition of variable via from ... import *

MethodCallsiteRefinement

An implicit (possible) modification of the object referred at a method call

MultiAssignmentDefinition

An assignment to a variable as part of a multiple assignment ..., v, ... = val

ParameterDefinition

A definition of a variable by declaring it as a parameter

PhiFunction

A Phi-function as specified in classic SSA form.

PyEdgeRefinement

Python specific sub-class of generic EssaEdgeRefinement

ScopeEntryDefinition

Definition of variable at the entry of a scope. Usually this represents the transfer of a global or non-local variable from one scope to another.

SelfCallsiteRefinement

An implicit (possible) modification of self at a method call

SingleSuccessorGuard

A pi-node (guard) with only one successor.

WithDefinition

A definition of a variable in a with statement

Aliases

PyNodeDefinition

A definition of an ESSA variable that is not directly linked to another ESSA variable.

PyNodeRefinement

A definition of an ESSA variable that takes another ESSA variable as an input.