CodeQL library for C/C++
Search

Module StackVariableReachability

Provides a library for working with local (intra-procedural) control-flow reachability involving stack variables.

Import path

import semmle.code.cpp.controlflow.StackVariableReachability

Imports

cpp

Provides classes and predicates for working with C/C++ code.

Predicates

bbSuccessorEntryReachesLoopInvariant

Loop invariant for bbSuccessorEntryReaches:

Classes

StackVariableReachability

A reachability analysis for control-flow nodes involving stack variables. This defines sources, sinks, and any other configurable aspect of the analysis. Multiple analyses can coexist. To create an analysis, extend this class with a subclass whose characteristic predicate is a unique singleton string. For example, write

StackVariableReachabilityExt

Same as StackVariableReachability, but isBarrier works on control-flow edges rather than nodes and is therefore parameterized by the original source node as well. Otherwise, this class is used like StackVariableReachability.

StackVariableReachabilityWithReassignment

Reachability analysis for control-flow nodes involving stack variables. Unlike StackVariableReachability, this analysis takes variable reassignments into account.