Query module AssignWhereCompareMeant

name
Assignment where comparison was intended
description
The ‘=’ operator may have been used accidentally, where ‘==’ was intended.
kind
problem
problem.severity
error
precision
high
id
cpp/assign-where-compare-meant
tags
reliability correctness external/cwe/cwe-481

Imports

LocalScopeVariableReachability
cpp

Provides classes and predicates for working with C/C++/ObjC/ObjC++ code.

Predicates

candidateResult

Holds if ae is a BooleanControllingAssignment that would be a result of this query, before checking for undef reachability.

candidateVariable

Holds if v is a Variable that might be assigned to in a result of this query.

Classes