Skip to content

Commit 5eef168

Browse files
Update EXP30-C to handle refactorehd ordering
1 parent 1139890 commit 5eef168

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

c/cert/src/rules/EXP30-C/DependenceOnOrderOfScalarEvaluationForSideEffects.ql

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,14 @@ import codingstandards.c.cert
2121
import codingstandards.cpp.SideEffect
2222
import codingstandards.c.Ordering
2323
import codingstandards.c.orderofevaluation.VariableAccessOrdering
24+
import Ordering::Make<VariableAccessInFullExpressionOrdering> as FullExpressionOrdering
2425

25-
from
26-
VariableAccessInFullExpressionOrdering config, FullExpr e, ScalarVariable v, VariableEffect ve,
27-
VariableAccess va1, VariableAccess va2
26+
from FullExpr e, ScalarVariable v, VariableEffect ve, VariableAccess va1, VariableAccess va2
2827
where
2928
not isExcluded(e, SideEffects1Package::dependenceOnOrderOfScalarEvaluationForSideEffectsQuery()) and
3029
e = va1.(ConstituentExpr).getFullExpr() and
3130
va1 = ve.getAnAccess() and
32-
config.isUnsequenced(va1, va2) and
31+
FullExpressionOrdering::isUnsequenced(va1, va2) and
3332
v = va1.getTarget()
3433
select e, "Scalar object referenced by $@ has a $@ that is unsequenced in relative to another $@.",
3534
v, v.getName(), ve, "side-effect", va2, "side-effect or value computation"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
- `A5-0-1`, `EXP50-CPP` - `ExpressionShouldNotRelyONOrderOfEvaluation.ql`, `DoNotDependOnTheOrderOfScalarObjectEvaluationForSideEffects.ql`:
22
- Fixed a bug where some sequenced operations were not detected as such due to an error in the "candidate selection" process. This could have complex effects on results, but should mostly fix false positives.
33
- Some unsequenced operations that previously reported one alert may now report two, due to the extra candidates being considered.
4-
- `RULE-13-2`, `A5-0-1`, `EXP50-CPP` - `UnsequencedSideEffects.ql`, `UnsequencedAtomicReads.ql`, `ExpressionShouldNotRelyONOrderOfEvaluation.ql`, `DoNotDependOnTheOrderOfScalarObjectEvaluationForSideEffects.ql`:
4+
- `RULE-13-2`, `A5-0-1`, `EXP50-CPP`, `EXP30-C` - `UnsequencedSideEffects.ql`, `UnsequencedAtomicReads.ql`, `ExpressionShouldNotRelyONOrderOfEvaluation.ql`, `DoNotDependOnTheOrderOfScalarObjectEvaluationForSideEffects.ql`, `DependenceOnOrderOfScalarEvaluationForSideEffects.ql`:
55
- Implementation of ordering has been refactored to share more code across specifications (C11-C17, C++14, and C++17 sequencing rules). No change in results is expected from this refactor.

0 commit comments

Comments
 (0)