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

Module LegacyPointsTo

DEPRECATED: Using the methods in this module may lead to a degradation of performance. Use at your own peril.

This module contains legacy points-to predicates and methods for various classes in the points-to analysis.

Existing code that depends on, say, points-to predicates on ControlFlowNode should be modified to use ControlFlowNodeWithPointsTo instead. In particular, if inside a method call chain such as

someCallNode.getFunction().pointsTo(...)

an explicit cast should be added as follows

someCallNode.getFunction().(ControlFlowNodeWithPointsTo).pointsTo(...)

Similarly, if a bound variable has type ControlFlowNode, and a points-to method is called on it, the type should be changed to ControlFlowNodeWithPointsTo.

Import path

import LegacyPointsTo

Imports

Base

Combined points-to and type-inference for “run-time” (as opposed to “import-time” values) The main relation runtime_points_to(node, object, cls, origin) relates a control flow node to the possible objects it points-to the inferred types of those objects and the ‘origin’ of those objects. The ‘origin’ is the point in source code that the object can be traced back to.

ClassObject
Context
Descriptors
Exceptions

Analysis of exception raising and handling.

FunctionObject
Metrics
ModuleObject
Object
ObjectAPI

Public API for “objects” A Value is a static approximation to a set of runtime objects.

ObjectInternal

Internal object API. For use by points-to and testing only.

PointsTo
PointsToContext
Properties
SelfAttribute

Utilities to support queries about instance attribute accesses of the form self.attr.

Predicates

getLiteralObject

Gets the Object corresponding to the immutable literal l.

globallyDefinedName

Whether this name is (almost) always defined, ie. it is a builtin or VM defined name

Classes

BasicBlockWithPointsTo

An extension of BasicBlock that provides points-to related methods.

ClassWithPointsTo

An extension of Class that provides points-to related methods.

ControlFlowNodeWithPointsTo

An extension of ControlFlowNode that provides points-to predicates.

ExprWithPointsTo

An extension of Expr that provides points-to predicates.

FunctionWithPointsTo

An extension of Function that provides points-to related methods.

ModuleWithPointsTo

An extension of Module that provides points-to related methods.

SsaVariableWithPointsTo

An extension of SsaVariable that provides points-to related methods.