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:
Mathias Vorreiter Pedersen
2020-01-10 13:14:00 +01:00
2 changed files with 3 additions and 3 deletions

View File

@@ -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

View File

@@ -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
}
}
}