CodeQL library for C/C++
codeql/cpp-all 0.12.12-dev (changelog, source)
Search

Predicate reachable

Holds if the control-flow node n is reachable, meaning that either it is an entry point, or there exists a path in the control-flow graph of its function that connects an entry point to it. Compile-time constant conditions are taken into account, so that the call to f is not reachable in if (0) f(); even if the if statement as a whole is reachable.

Import path

import cpp
predicate reachable(ControlFlowNode n)