Skip to content

Commit 84b1ad8

Browse files
committed
Add comments to explain steps
1 parent f0ee5b1 commit 84b1ad8

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

c/misra/src/rules/RULE-13-2/UnsequencedSideEffects.ql

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,11 @@ where
6262
sameFullExpr(fullExpr, va1, va2) and
6363
effect(variableEffect1, va1, v1) and
6464
effect(variableEffect2, va2, v2) and
65+
// Exclude the same effect applying to different objects.
66+
// This occurs when on is a subject of the other.
67+
// For example, foo.bar = 1; where both foo and bar are objects modified by the assignment.
6568
variableEffect1 != variableEffect2 and
66-
// If the effect is local we can directly check if it is unsequenced.
67-
// If the effect is not local (happens in a different function) we use the access as a proxy.
69+
// If the effect is not local (happens in a different function) we use the call with the access as a proxy.
6870
(
6971
va1.getEnclosingStmt() = variableEffect1.getEnclosingStmt() and
7072
va2.getEnclosingStmt() = variableEffect2.getEnclosingStmt() and

0 commit comments

Comments
 (0)