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

Predicate eqZeroWithNegate

Holds if branch of cmp is taken when a compares isEQ to zero.

Note that a can be cmp itself or a conversion thereof.

Import path

import semmle.code.cpp.rangeanalysis.RangeAnalysisUtils
predicate eqZeroWithNegate(Expr cmp, Expr a, boolean isEQ, boolean branch)