CodeQL library for C/C++

Predicate conditionalSuccessor

Holds if node is an expression in a conditional statement and succ is an immediate successor of node that may be reached after evaluating node. For example, given

if (a < 10 && b) func1();
else func2();

this predicate holds when either:

  • node is a < 10 and succ is func2() or b, or
  • node is b and succ is func1() or func2()

Import path

import Critical.Negativity
predicate conditionalSuccessor(ControlFlowNode node, ControlFlowNode succ)