Skip to content

Commit 20280e7

Browse files
committed
Update error message format in EXP50-CPP rule and adjust SideEffect module imports
1 parent 55b6f53 commit 20280e7

4 files changed

Lines changed: 32 additions & 20 deletions

File tree

cpp/cert/src/rules/EXP50-CPP/DoNotDependOnTheOrderOfScalarObjectEvaluationForSideEffects.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,5 @@ where
3333
va1 = ve.getAnAccess() and
3434
FullExprOrdering::isUnsequenced(va1, va2) and
3535
v = va1.getTarget()
36-
select e, "Scalar object referenced by $@ has a $@ that is unsequenced in relative to another $@.",
36+
select e, "Scalar object referenced by $@ has a $@ that is unsequenced relative to another $@.",
3737
v, v.getName(), ve, "side-effect", va2, "side-effect or value computation"
Lines changed: 29 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,29 @@
1-
| test.cpp:8:3:9:8 | ... = ... | Scalar object referenced by $@ has a $@ that is unsequenced in relative to another $@. | test.cpp:4:5:4:6 | g1 | g1 | test.cpp:8:3:9:8 | ... = ... | side-effect | test.cpp:8:10:8:11 | g1 | side-effect or value computation |
2-
| test.cpp:8:3:9:8 | ... = ... | Scalar object referenced by $@ has a $@ that is unsequenced in relative to another $@. | test.cpp:4:5:4:6 | g1 | g1 | test.cpp:8:8:8:11 | ++ ... | side-effect | test.cpp:8:3:8:4 | g1 | side-effect or value computation |
3-
| test.cpp:10:3:10:15 | ... = ... | Scalar object referenced by $@ has a $@ that is unsequenced in relative to another $@. | test.cpp:4:5:4:6 | g1 | g1 | test.cpp:10:6:10:9 | ... ++ | side-effect | test.cpp:10:14:10:15 | g1 | side-effect or value computation |
4-
| test.cpp:14:3:14:12 | ... += ... | Scalar object referenced by $@ has a $@ that is unsequenced in relative to another $@. | test.cpp:4:5:4:6 | g1 | g1 | test.cpp:14:3:14:12 | ... += ... | side-effect | test.cpp:14:9:14:10 | g1 | side-effect or value computation |
5-
| test.cpp:14:3:14:12 | ... += ... | Scalar object referenced by $@ has a $@ that is unsequenced in relative to another $@. | test.cpp:4:5:4:6 | g1 | g1 | test.cpp:14:9:14:12 | ... ++ | side-effect | test.cpp:14:3:14:4 | g1 | side-effect or value computation |
6-
| test.cpp:15:3:16:11 | ... = ... | Scalar object referenced by $@ has a $@ that is unsequenced in relative to another $@. | test.cpp:4:5:4:6 | g1 | g1 | test.cpp:15:3:16:11 | ... = ... | side-effect | test.cpp:15:8:15:9 | g1 | side-effect or value computation |
7-
| test.cpp:15:3:16:11 | ... = ... | Scalar object referenced by $@ has a $@ that is unsequenced in relative to another $@. | test.cpp:4:5:4:6 | g1 | g1 | test.cpp:15:8:16:11 | ... += ... | side-effect | test.cpp:15:3:15:4 | g1 | side-effect or value computation |
8-
| test.cpp:21:3:21:4 | call to f2 | Scalar object referenced by $@ has a $@ that is unsequenced in relative to another $@. | test.cpp:20:13:20:14 | p1 | p1 | test.cpp:21:6:21:9 | ... ++ | side-effect | test.cpp:21:12:21:13 | p1 | side-effect or value computation |
9-
| test.cpp:28:13:28:13 | call to operator<< | Scalar object referenced by $@ has a $@ that is unsequenced in relative to another $@. | test.cpp:26:13:26:14 | p1 | p1 | test.cpp:27:16:27:19 | ... ++ | side-effect | test.cpp:27:24:27:25 | p1 | side-effect or value computation |
10-
| test.cpp:92:3:92:4 | call to f2 | Scalar object referenced by $@ has a $@ that is unsequenced in relative to another $@. | test.cpp:91:7:91:7 | i | i | test.cpp:62:25:62:30 | ++ ... | side-effect | test.cpp:92:18:92:18 | i | side-effect or value computation |
11-
| test.cpp:92:3:92:4 | call to f2 | Scalar object referenced by $@ has a $@ that is unsequenced in relative to another $@. | test.cpp:91:7:91:7 | i | i | test.cpp:66:3:66:8 | ... = ... | side-effect | test.cpp:92:10:92:10 | i | side-effect or value computation |
12-
| test.cpp:93:3:93:4 | call to f2 | Scalar object referenced by $@ has a $@ that is unsequenced in relative to another $@. | test.cpp:91:7:91:7 | i | i | test.cpp:62:25:62:30 | ++ ... | side-effect | test.cpp:93:10:93:10 | i | side-effect or value computation |
13-
| test.cpp:93:3:93:4 | call to f2 | Scalar object referenced by $@ has a $@ that is unsequenced in relative to another $@. | test.cpp:91:7:91:7 | i | i | test.cpp:62:25:62:30 | ++ ... | side-effect | test.cpp:93:19:93:19 | i | side-effect or value computation |
14-
| test.cpp:95:3:95:4 | call to f2 | Scalar object referenced by $@ has a $@ that is unsequenced in relative to another $@. | test.cpp:91:7:91:7 | i | i | test.cpp:63:25:63:27 | ++ ... | side-effect | test.cpp:95:16:95:16 | i | side-effect or value computation |
15-
| test.cpp:95:3:95:4 | call to f2 | Scalar object referenced by $@ has a $@ that is unsequenced in relative to another $@. | test.cpp:91:7:91:7 | i | i | test.cpp:71:3:71:7 | ... = ... | side-effect | test.cpp:95:9:95:9 | i | side-effect or value computation |
16-
| test.cpp:96:3:96:4 | call to f2 | Scalar object referenced by $@ has a $@ that is unsequenced in relative to another $@. | test.cpp:91:7:91:7 | i | i | test.cpp:63:25:63:27 | ++ ... | side-effect | test.cpp:96:9:96:9 | i | side-effect or value computation |
17-
| test.cpp:96:3:96:4 | call to f2 | Scalar object referenced by $@ has a $@ that is unsequenced in relative to another $@. | test.cpp:91:7:91:7 | i | i | test.cpp:63:25:63:27 | ++ ... | side-effect | test.cpp:96:17:96:17 | i | side-effect or value computation |
1+
| test.cpp:8:3:9:8 | ... = ... | Scalar object referenced by $@ has a $@ that is unsequenced relative to another $@. | test.cpp:4:5:4:6 | g1 | g1 | test.cpp:8:3:9:8 | ... = ... | side-effect | test.cpp:8:10:8:11 | g1 | side-effect or value computation |
2+
| test.cpp:8:3:9:8 | ... = ... | Scalar object referenced by $@ has a $@ that is unsequenced relative to another $@. | test.cpp:4:5:4:6 | g1 | g1 | test.cpp:8:8:8:11 | ++ ... | side-effect | test.cpp:8:3:8:4 | g1 | side-effect or value computation |
3+
| test.cpp:10:3:10:15 | ... = ... | Scalar object referenced by $@ has a $@ that is unsequenced relative to another $@. | test.cpp:4:5:4:6 | g1 | g1 | test.cpp:10:6:10:9 | ... ++ | side-effect | test.cpp:10:14:10:15 | g1 | side-effect or value computation |
4+
| test.cpp:14:3:14:12 | ... += ... | Scalar object referenced by $@ has a $@ that is unsequenced relative to another $@. | test.cpp:4:5:4:6 | g1 | g1 | test.cpp:14:3:14:12 | ... += ... | side-effect | test.cpp:14:9:14:10 | g1 | side-effect or value computation |
5+
| test.cpp:14:3:14:12 | ... += ... | Scalar object referenced by $@ has a $@ that is unsequenced relative to another $@. | test.cpp:4:5:4:6 | g1 | g1 | test.cpp:14:9:14:12 | ... ++ | side-effect | test.cpp:14:3:14:4 | g1 | side-effect or value computation |
6+
| test.cpp:15:3:16:11 | ... = ... | Scalar object referenced by $@ has a $@ that is unsequenced relative to another $@. | test.cpp:4:5:4:6 | g1 | g1 | test.cpp:15:3:16:11 | ... = ... | side-effect | test.cpp:15:8:15:9 | g1 | side-effect or value computation |
7+
| test.cpp:15:3:16:11 | ... = ... | Scalar object referenced by $@ has a $@ that is unsequenced relative to another $@. | test.cpp:4:5:4:6 | g1 | g1 | test.cpp:15:8:16:11 | ... += ... | side-effect | test.cpp:15:3:15:4 | g1 | side-effect or value computation |
8+
| test.cpp:21:3:21:4 | call to f2 | Scalar object referenced by $@ has a $@ that is unsequenced relative to another $@. | test.cpp:20:13:20:14 | p1 | p1 | test.cpp:21:6:21:9 | ... ++ | side-effect | test.cpp:21:12:21:13 | p1 | side-effect or value computation |
9+
| test.cpp:28:13:28:13 | call to operator<< | Scalar object referenced by $@ has a $@ that is unsequenced relative to another $@. | test.cpp:26:13:26:14 | p1 | p1 | test.cpp:27:16:27:19 | ... ++ | side-effect | test.cpp:27:24:27:25 | p1 | side-effect or value computation |
10+
| test.cpp:92:3:92:4 | call to f2 | Scalar object referenced by $@ has a $@ that is unsequenced relative to another $@. | test.cpp:91:7:91:7 | i | i | test.cpp:62:25:62:30 | ++ ... | side-effect | test.cpp:92:10:92:10 | i | side-effect or value computation |
11+
| test.cpp:92:3:92:4 | call to f2 | Scalar object referenced by $@ has a $@ that is unsequenced relative to another $@. | test.cpp:91:7:91:7 | i | i | test.cpp:62:25:62:30 | ++ ... | side-effect | test.cpp:92:18:92:18 | i | side-effect or value computation |
12+
| test.cpp:92:3:92:4 | call to f2 | Scalar object referenced by $@ has a $@ that is unsequenced relative to another $@. | test.cpp:91:7:91:7 | i | i | test.cpp:63:25:63:27 | ++ ... | side-effect | test.cpp:92:10:92:10 | i | side-effect or value computation |
13+
| test.cpp:92:3:92:4 | call to f2 | Scalar object referenced by $@ has a $@ that is unsequenced relative to another $@. | test.cpp:91:7:91:7 | i | i | test.cpp:63:25:63:27 | ++ ... | side-effect | test.cpp:92:18:92:18 | i | side-effect or value computation |
14+
| test.cpp:92:3:92:4 | call to f2 | Scalar object referenced by $@ has a $@ that is unsequenced relative to another $@. | test.cpp:91:7:91:7 | i | i | test.cpp:66:3:66:8 | ... = ... | side-effect | test.cpp:92:10:92:10 | i | side-effect or value computation |
15+
| test.cpp:92:3:92:4 | call to f2 | Scalar object referenced by $@ has a $@ that is unsequenced relative to another $@. | test.cpp:91:7:91:7 | i | i | test.cpp:66:3:66:8 | ... = ... | side-effect | test.cpp:92:18:92:18 | i | side-effect or value computation |
16+
| test.cpp:92:3:92:4 | call to f2 | Scalar object referenced by $@ has a $@ that is unsequenced relative to another $@. | test.cpp:91:7:91:7 | i | i | test.cpp:71:3:71:7 | ... = ... | side-effect | test.cpp:92:10:92:10 | i | side-effect or value computation |
17+
| test.cpp:92:3:92:4 | call to f2 | Scalar object referenced by $@ has a $@ that is unsequenced relative to another $@. | test.cpp:91:7:91:7 | i | i | test.cpp:71:3:71:7 | ... = ... | side-effect | test.cpp:92:18:92:18 | i | side-effect or value computation |
18+
| test.cpp:93:3:93:4 | call to f2 | Scalar object referenced by $@ has a $@ that is unsequenced relative to another $@. | test.cpp:91:7:91:7 | i | i | test.cpp:62:25:62:30 | ++ ... | side-effect | test.cpp:93:10:93:10 | i | side-effect or value computation |
19+
| test.cpp:93:3:93:4 | call to f2 | Scalar object referenced by $@ has a $@ that is unsequenced relative to another $@. | test.cpp:91:7:91:7 | i | i | test.cpp:62:25:62:30 | ++ ... | side-effect | test.cpp:93:19:93:19 | i | side-effect or value computation |
20+
| test.cpp:93:3:93:4 | call to f2 | Scalar object referenced by $@ has a $@ that is unsequenced relative to another $@. | test.cpp:91:7:91:7 | i | i | test.cpp:63:25:63:27 | ++ ... | side-effect | test.cpp:93:10:93:10 | i | side-effect or value computation |
21+
| test.cpp:93:3:93:4 | call to f2 | Scalar object referenced by $@ has a $@ that is unsequenced relative to another $@. | test.cpp:91:7:91:7 | i | i | test.cpp:63:25:63:27 | ++ ... | side-effect | test.cpp:93:19:93:19 | i | side-effect or value computation |
22+
| test.cpp:93:3:93:4 | call to f2 | Scalar object referenced by $@ has a $@ that is unsequenced relative to another $@. | test.cpp:91:7:91:7 | i | i | test.cpp:71:3:71:7 | ... = ... | side-effect | test.cpp:93:10:93:10 | i | side-effect or value computation |
23+
| test.cpp:93:3:93:4 | call to f2 | Scalar object referenced by $@ has a $@ that is unsequenced relative to another $@. | test.cpp:91:7:91:7 | i | i | test.cpp:71:3:71:7 | ... = ... | side-effect | test.cpp:93:19:93:19 | i | side-effect or value computation |
24+
| test.cpp:95:3:95:4 | call to f2 | Scalar object referenced by $@ has a $@ that is unsequenced relative to another $@. | test.cpp:91:7:91:7 | i | i | test.cpp:63:25:63:27 | ++ ... | side-effect | test.cpp:95:9:95:9 | i | side-effect or value computation |
25+
| test.cpp:95:3:95:4 | call to f2 | Scalar object referenced by $@ has a $@ that is unsequenced relative to another $@. | test.cpp:91:7:91:7 | i | i | test.cpp:63:25:63:27 | ++ ... | side-effect | test.cpp:95:16:95:16 | i | side-effect or value computation |
26+
| test.cpp:95:3:95:4 | call to f2 | Scalar object referenced by $@ has a $@ that is unsequenced relative to another $@. | test.cpp:91:7:91:7 | i | i | test.cpp:71:3:71:7 | ... = ... | side-effect | test.cpp:95:9:95:9 | i | side-effect or value computation |
27+
| test.cpp:95:3:95:4 | call to f2 | Scalar object referenced by $@ has a $@ that is unsequenced relative to another $@. | test.cpp:91:7:91:7 | i | i | test.cpp:71:3:71:7 | ... = ... | side-effect | test.cpp:95:16:95:16 | i | side-effect or value computation |
28+
| test.cpp:96:3:96:4 | call to f2 | Scalar object referenced by $@ has a $@ that is unsequenced relative to another $@. | test.cpp:91:7:91:7 | i | i | test.cpp:63:25:63:27 | ++ ... | side-effect | test.cpp:96:9:96:9 | i | side-effect or value computation |
29+
| test.cpp:96:3:96:4 | call to f2 | Scalar object referenced by $@ has a $@ that is unsequenced relative to another $@. | test.cpp:91:7:91:7 | i | i | test.cpp:63:25:63:27 | ++ ... | side-effect | test.cpp:96:17:96:17 | i | side-effect or value computation |

cpp/common/src/codingstandards/cpp/SideEffect.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/** A module to reason about side effects. */
22

33
import cpp
4-
private import semmle.code.cpp.dataflow.DataFlow
4+
private import semmle.code.cpp.dataflow.new.DataFlow
55
private import exceptions.ExceptionFlow
66
private import codingstandards.cpp.Expr
77
private import codingstandards.cpp.Variable

cpp/common/src/codingstandards/cpp/standardlibrary/STLContainers.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ abstract class ContainerAccess extends VariableAccess {
311311
abstract Variable getOwningContainer();
312312
}
313313

314-
pragma[noinline, nomagic]
314+
pragma[inline]
315315
private predicate localTaint(DataFlow::Node n1, DataFlow::Node n2) {
316316
TaintTracking::localTaint(n1, n2)
317317
}

0 commit comments

Comments
 (0)