Skip to content

Commit 66b4267

Browse files
committed
Fix #755.
1 parent 2a805c0 commit 66b4267

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
- `M6-5-3` - `Loops.qll`:
2+
- Fixes #755. Specifies that the access to the loop counter must be via non-const address.

cpp/common/src/codingstandards/cpp/Loops.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ predicate isLoopCounterModifiedInCondition(ForStmt forLoop, VariableAccess loopC
204204
loopCounterAccess = getAnIterationVariable(forLoop).getAnAccess() and
205205
(
206206
loopCounterAccess.isModified() or
207-
loopCounterAccess.isAddressOfAccess()
207+
loopCounterAccess.isAddressOfAccessNonConst()
208208
)
209209
}
210210

@@ -219,7 +219,7 @@ predicate isLoopCounterModifiedInStatement(
219219
loopCounterAccess = loopCounter.getAnAccess() and
220220
(
221221
loopCounterAccess.isModified() or
222-
loopCounterAccess.isAddressOfAccess()
222+
loopCounterAccess.isAddressOfAccessNonConst()
223223
) and
224224
forLoop.getStmt().getChildStmt*() = loopCounterAccess.getEnclosingStmt()
225225
}

0 commit comments

Comments
 (0)