Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 111f1db

Browse files
committed
Merge branch 'assign-where-compare-meant-false-positives' of github.com:MathiasVP/ql into assign-where-compare-meant-false-positives
2 parents f80c13a + f181753 commit 111f1db

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

cpp/ql/src/Likely Bugs/Likely Typos/AssignWhereCompareMeant.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class BooleanControllingAssignmentInExpr extends BooleanControllingAssignment {
5555
this.getConversion().(ParenthesisExpr).isParenthesised()
5656
or
5757
// whitelist this assignment if all comparison operations in the expression that this
58-
// assignment is part of, are ot parenthesized. In that case it seems like programmer
58+
// assignment is part of, are not parenthesized. In that case it seems like programmer
5959
// is fine with unparenthesized comparison operands to binary logical operators, and
6060
// the parenthesis around this assignment was used to call it out as an assignment.
6161
this.isParenthesised() and

cpp/ql/test/query-tests/Likely Bugs/Likely Typos/AssignWhereCompareMeant/test.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ void g(int *i_p, int cond) {
102102
template<typename>
103103
void h() {
104104
int x;
105-
if(x = 0) { // GOOD: x is not initialized so this is probably intensional
105+
if(x = 0) { // GOOD: x is not initialized so this is probably intentional
106106
}
107107

108108
int y = 0;
@@ -152,4 +152,4 @@ void f3(int x, int y) {
152152

153153
if((x == 10) || ((z == z) && (x == 1)) && (y = 2)) { // BAD
154154
}
155-
}
155+
}

0 commit comments

Comments
 (0)