Skip to content

Commit e135fe6

Browse files
committed
Fix cross-join issue in TLoopCounterUpdatedNotByCrementOrAddSubAssignmentExpr
1 parent 7d5f08b commit e135fe6

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

cpp/misra/src/rules/RULE-9-5-1/LegacyForStatementsShouldBeSimple.ql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,7 @@ private newtype TAlertType =
178178
ForStmt forLoop, Variable loopCounterVariable, Expr updateExpr
179179
) {
180180
loopCounterVariable = getDeclaredVariableInForLoop(forLoop) and
181+
updateExpr = forLoop.getUpdate() and
181182
variableModifiedInExpression(updateExpr, loopCounterVariable.getAnAccess()) and
182183
not updateExpr instanceof StepCrementUpdateExpr
183184
} or

0 commit comments

Comments
 (0)