CodeQL library for C/C++

Predicate useOfVar

Holds if use is a non-definition use of stack variable v. This will not include accesses on the LHS of an assignment (which don’t retrieve the variable value), but will include accesses in increment/decrement operations.

Import path

import cpp
predicate useOfVar(SemanticStackVariable v, VariableAccess use)