CodeQL library for C/C++
codeql/cpp-all 2.1.2-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)