CodeQL library for C/C++
Search

Predicate errorCondition

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

  • cond checks that v is equal to -1, or
  • cond checks that v is less than 0, or
  • cond checks that v is less than or equal to -1, or
  • cond checks that v is not some common success value (see successCondition).

Import path

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