Skip to content

Commit 2ceb25d

Browse files
committed
C++: Order left and right operands in the logical left to right order
1 parent a6048dd commit 2ceb25d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cpp/ql/lib/semmle/code/cpp/controlflow/Nullness.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ predicate nullCheckExpr(Expr checkExpr, Variable var) {
4646
or
4747
exists(LogicalAndExpr op, AnalysedExpr child |
4848
expr = op and
49-
(op.getRightOperand() = child or op.getLeftOperand() = child) and
49+
(op.getLeftOperand() = child or op.getRightOperand() = child) and
5050
nullCheckExpr(child, v)
5151
)
5252
or
@@ -99,7 +99,7 @@ predicate validCheckExpr(Expr checkExpr, Variable var) {
9999
or
100100
exists(LogicalAndExpr op, AnalysedExpr child |
101101
expr = op and
102-
(op.getRightOperand() = child or op.getLeftOperand() = child) and
102+
(op.getLeftOperand() = child or op.getRightOperand() = child) and
103103
validCheckExpr(child, v)
104104
)
105105
or

0 commit comments

Comments
 (0)