Skip to content

Commit 2aceba8

Browse files
committed
Convert A5-1-7 to use the new dataflow library
1 parent f4d7e9f commit 2aceba8

File tree

4 files changed

+15
-19
lines changed

4 files changed

+15
-19
lines changed

cpp/autosar/src/rules/A5-1-7/LambdaPassedToDecltype.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
import cpp
1717
import codingstandards.cpp.autosar
18-
import semmle.code.cpp.dataflow.DataFlow
18+
import semmle.code.cpp.dataflow.new.DataFlow
1919

2020
module LambdaExpressionToInitializerConfig implements DataFlow::ConfigSig {
2121
predicate isSource(DataFlow::Node source) { source.asExpr() instanceof LambdaExpression }

cpp/autosar/src/rules/A5-1-7/LambdaPassedToTypeid.ql

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,16 @@
1414
*/
1515

1616
import cpp
17-
import semmle.code.cpp.dataflow.DataFlow
17+
import semmle.code.cpp.dataflow.new.DataFlow
1818
import codingstandards.cpp.autosar
1919
import LambdaExpressionToTypeidFlow::PathGraph
2020

2121
module LambdaExpressionToTypeidConfig implements DataFlow::ConfigSig {
2222
predicate isSource(DataFlow::Node source) { source.asExpr() instanceof LambdaExpression }
2323

24-
predicate isSink(DataFlow::Node sink) { exists(TypeidOperator op | op.getExpr() = sink.asExpr()) }
24+
predicate isSink(DataFlow::Node sink) {
25+
exists(TypeidOperator op | op.getExpr() = sink.asIndirectExpr())
26+
}
2527
}
2628

2729
module LambdaExpressionToTypeidFlow = DataFlow::Global<LambdaExpressionToTypeidConfig>;
Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1 @@
1-
WARNING: module 'DataFlow' has been deprecated and may be removed in future (LambdaPassedToDecltype.ql:20,55-63)
2-
WARNING: module 'DataFlow' has been deprecated and may be removed in future (LambdaPassedToDecltype.ql:21,22-30)
3-
WARNING: module 'DataFlow' has been deprecated and may be removed in future (LambdaPassedToDecltype.ql:23,20-28)
4-
WARNING: module 'DataFlow' has been deprecated and may be removed in future (LambdaPassedToDecltype.ql:28,44-52)
5-
WARNING: module 'DataFlow' has been deprecated and may be removed in future (LambdaPassedToDecltype.ql:39,47-55)
6-
WARNING: module 'DataFlow' has been deprecated and may be removed in future (LambdaPassedToDecltype.ql:40,9-17)
71
| test.cpp:14:23:14:24 | decltype(...) | Lambda $@ passed as operand to decltype. | test.cpp:5:13:5:30 | [...](...){...} | expression |
Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
WARNING: module 'DataFlow' has been deprecated and may be removed in future (LambdaPassedToTypeid.ql:21,50-58)
2-
WARNING: module 'DataFlow' has been deprecated and may be removed in future (LambdaPassedToTypeid.ql:22,22-30)
3-
WARNING: module 'DataFlow' has been deprecated and may be removed in future (LambdaPassedToTypeid.ql:24,20-28)
4-
WARNING: module 'DataFlow' has been deprecated and may be removed in future (LambdaPassedToTypeid.ql:27,39-47)
51
edges
6-
| test.cpp:5:13:5:30 | [...](...){...} | test.cpp:8:38:8:39 | l1 | provenance | |
7-
| test.cpp:6:13:6:30 | [...](...){...} | test.cpp:9:38:9:39 | l2 | provenance | |
2+
| test.cpp:5:13:5:30 | [...](...){...} | test.cpp:5:13:5:30 | [...](...){...} | provenance | |
3+
| test.cpp:5:13:5:30 | [...](...){...} | test.cpp:8:38:8:39 | *l1 | provenance | |
4+
| test.cpp:6:13:6:30 | [...](...){...} | test.cpp:6:13:6:30 | [...](...){...} | provenance | |
5+
| test.cpp:6:13:6:30 | [...](...){...} | test.cpp:9:38:9:39 | *l2 | provenance | |
86
nodes
97
| test.cpp:5:13:5:30 | [...](...){...} | semmle.label | [...](...){...} |
8+
| test.cpp:5:13:5:30 | [...](...){...} | semmle.label | [...](...){...} |
9+
| test.cpp:6:13:6:30 | [...](...){...} | semmle.label | [...](...){...} |
1010
| test.cpp:6:13:6:30 | [...](...){...} | semmle.label | [...](...){...} |
11-
| test.cpp:8:38:8:39 | l1 | semmle.label | l1 |
12-
| test.cpp:9:38:9:39 | l2 | semmle.label | l2 |
11+
| test.cpp:8:38:8:39 | *l1 | semmle.label | *l1 |
12+
| test.cpp:9:38:9:39 | *l2 | semmle.label | *l2 |
1313
subpaths
1414
#select
15-
| test.cpp:8:38:8:39 | l1 | test.cpp:5:13:5:30 | [...](...){...} | test.cpp:8:38:8:39 | l1 | Lambda $@ passed as operand to typeid operator. | test.cpp:5:13:5:30 | [...](...){...} | expression |
16-
| test.cpp:9:38:9:39 | l2 | test.cpp:6:13:6:30 | [...](...){...} | test.cpp:9:38:9:39 | l2 | Lambda $@ passed as operand to typeid operator. | test.cpp:6:13:6:30 | [...](...){...} | expression |
15+
| test.cpp:8:38:8:39 | *l1 | test.cpp:5:13:5:30 | [...](...){...} | test.cpp:8:38:8:39 | *l1 | Lambda $@ passed as operand to typeid operator. | test.cpp:5:13:5:30 | [...](...){...} | expression |
16+
| test.cpp:9:38:9:39 | *l2 | test.cpp:6:13:6:30 | [...](...){...} | test.cpp:9:38:9:39 | *l2 | Lambda $@ passed as operand to typeid operator. | test.cpp:6:13:6:30 | [...](...){...} | expression |

0 commit comments

Comments
 (0)