CodeQL library for C/C++
codeql/cpp-all 0.7.2 ( changelog , source )

Module Cached :: ControlFlowGraphPublic

Provides predicates that should be exported as if they were top-level predicates in ControlFlowGraph.qll. They have to be defined in this file in order to be grouped in a cached module with other predicates that must go in the same cached stage.

Import path

import semmle.code.cpp.controlflow.internal.ConstantExprs



Holds if condition always evaluates to zero.


Holds if condition always evaluates to a nonzero value.


The condition condition for the loop loop is provably true upon entry. That is, at least one iteration of the loop is guaranteed.


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.