mirror of
https://github.com/github/codeql.git
synced 2026-04-29 02:35:15 +02:00
Merge branch 'assign-where-compare-meant-false-positives' of github.com:MathiasVP/ql into assign-where-compare-meant-false-positives
This commit is contained in:
@@ -55,7 +55,7 @@ class BooleanControllingAssignmentInExpr extends BooleanControllingAssignment {
|
||||
this.getConversion().(ParenthesisExpr).isParenthesised()
|
||||
or
|
||||
// whitelist this assignment if all comparison operations in the expression that this
|
||||
// assignment is part of, are ot parenthesized. In that case it seems like programmer
|
||||
// assignment is part of, are not parenthesized. In that case it seems like programmer
|
||||
// is fine with unparenthesized comparison operands to binary logical operators, and
|
||||
// the parenthesis around this assignment was used to call it out as an assignment.
|
||||
this.isParenthesised() and
|
||||
|
||||
@@ -102,7 +102,7 @@ void g(int *i_p, int cond) {
|
||||
template<typename>
|
||||
void h() {
|
||||
int x;
|
||||
if(x = 0) { // GOOD: x is not initialized so this is probably intensional
|
||||
if(x = 0) { // GOOD: x is not initialized so this is probably intentional
|
||||
}
|
||||
|
||||
int y = 0;
|
||||
@@ -152,4 +152,4 @@ void f3(int x, int y) {
|
||||
|
||||
if((x == 10) || ((z == z) && (x == 1)) && (y = 2)) { // BAD
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user