CodeQL library for C/C++
Search

Predicate successCondition

Holds if cond compares v to some common success values. Specifically, this predicate holds when:

  • cond checks that v is not equal to -1, or
  • cond checks that v is greater than or equal than 0, or
  • cond checks that v is greater than -1, or
  • cond checks that v is not some common error value (see errorCondition).

Import path

import Critical.Negativity
predicate successCondition(Variable v, Expr cond)