Skip to content

Commit

Permalink
Fix github#755.
Browse files Browse the repository at this point in the history
  • Loading branch information
fjatWbyT committed Oct 22, 2024
1 parent 2a805c0 commit 66b4267
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions change_notes/2024-10-22-fix-fp-m6-5-3.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- `M6-5-3` - `Loops.qll`:
- Fixes #755. Specifies that the access to the loop counter must be via non-const address.
4 changes: 2 additions & 2 deletions cpp/common/src/codingstandards/cpp/Loops.qll
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ predicate isLoopCounterModifiedInCondition(ForStmt forLoop, VariableAccess loopC
loopCounterAccess = getAnIterationVariable(forLoop).getAnAccess() and
(
loopCounterAccess.isModified() or
loopCounterAccess.isAddressOfAccess()
loopCounterAccess.isAddressOfAccessNonConst()
)
}

Expand All @@ -219,7 +219,7 @@ predicate isLoopCounterModifiedInStatement(
loopCounterAccess = loopCounter.getAnAccess() and
(
loopCounterAccess.isModified() or
loopCounterAccess.isAddressOfAccess()
loopCounterAccess.isAddressOfAccessNonConst()
) and
forLoop.getStmt().getChildStmt*() = loopCounterAccess.getEnclosingStmt()
}
Expand Down

0 comments on commit 66b4267

Please sign in to comment.