CodeQL library for Swift
codeql/swift-all 6.8.9 (changelog, source)
Search

Module Flow::ConsistencyChecks

Provides consistency checks for an instantiation of the variable capture library.

Import path

import codeql.dataflow.VariableCapture

Imports

DfConsistency

Provides consistency checks that depend on the DataFlowIntegration inputs.

Predicates

closureAliasMustBeInSameScope

Holds if access is an alias of closure expression ce outside the lexical scope of ce, as described by msg.

closureMustHaveBody

Holds if closure expression ce has no callable body, as described by msg.

consistencyOverview

Holds if n elements violate a variable capture consistency check, as described by msg.

localDominator

Holds if an immediate dominator of bb belongs to a different callable, as described by msg.

localSuccessor

Holds if a successor of bb belongs to a different callable, as described by msg.

uniqueCallableLocation

Holds if relevant callable c does not have exactly one location, as described by msg.

uniqueCfgNode

Holds if relevant expression e does not have exactly one CFG node, as described by msg.

uniqueDefiningScope

Holds if captured variable v does not have exactly one defining callable, as described by msg.

uniqueDominator

Holds if bb has multiple immediate dominators, as described by msg.

uniqueEnclosingCallable

Holds if bb does not have exactly one enclosing callable, as described by msg.

uniqueLocation

Holds if relevant expression e does not have exactly one location, as described by msg.

uniqueReadVariable

Holds if variable read vr does not have exactly one source variable, as described by msg.

uniqueToString

Holds if n relevant elements have either no textual representation or multiple textual representations, as described by msg.

uniqueWriteCfgNode

Holds if a captured-variable write does not have exactly one CFG node, as described by msg.

uniqueWriteTarget

Holds if a captured-variable write does not have exactly one target variable, as described by msg.

variableAccessAstNesting

Holds if callable c accesses captured variable v but is not lexically nested in the callable that defines v, as described by msg.

variableIsCaptured

Holds if v is classified as a captured variable but has no access from a capturing callable, as described by msg.