Skip to content

Commit e4d4a85

Browse files
committed
Update ConstLikeReturnValue to the new dataflow library
Note that there's a small issue here where the dataflow library causes one of the results to get duplicated.
1 parent 42838bf commit e4d4a85

File tree

2 files changed

+15
-6
lines changed

2 files changed

+15
-6
lines changed

cpp/common/src/codingstandards/cpp/rules/constlikereturnvalue/ConstLikeReturnValue.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import cpp
99
import codingstandards.cpp.Customizations
1010
import codingstandards.cpp.Exclusions
11-
import semmle.code.cpp.dataflow.DataFlow
11+
import semmle.code.cpp.dataflow.new.DataFlow
1212
import DFFlow::PathGraph
1313

1414
abstract class ConstLikeReturnValueSharedQuery extends Query { }
Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,29 @@
11
problems
2-
| test.cpp:11:8:11:12 | c_str | test.cpp:18:16:18:21 | call to getenv | test.cpp:11:8:11:12 | c_str | The object returned by the function getenv should not be modified. |
2+
| test.cpp:11:7:11:12 | * ... | test.cpp:18:16:18:21 | call to getenv | test.cpp:11:7:11:12 | * ... | The object returned by the function getenv should not be modified. |
3+
| test.cpp:11:8:11:12 | c_str | test.cpp:18:16:18:21 | call to getenv | test.cpp:11:7:11:12 | * ... | The object returned by the function getenv should not be modified. |
34
| test.cpp:67:5:67:9 | conv4 | test.cpp:64:11:64:20 | call to localeconv | test.cpp:67:5:67:9 | conv4 | The object returned by the function localeconv should not be modified. |
45
| test.cpp:76:5:76:8 | conv | test.cpp:72:25:72:34 | call to localeconv | test.cpp:76:5:76:8 | conv | The object returned by the function localeconv should not be modified. |
56
edges
6-
| test.cpp:8:18:8:22 | c_str | test.cpp:11:8:11:12 | c_str | provenance | |
7+
| test.cpp:8:18:8:22 | c_str | test.cpp:11:7:11:12 | * ... | provenance | |
8+
| test.cpp:18:16:18:21 | call to getenv | test.cpp:18:16:18:21 | call to getenv | provenance | |
79
| test.cpp:18:16:18:21 | call to getenv | test.cpp:24:9:24:12 | env1 | provenance | |
810
| test.cpp:24:9:24:12 | env1 | test.cpp:8:18:8:22 | c_str | provenance | |
9-
| test.cpp:64:11:64:20 | call to localeconv | test.cpp:67:5:67:9 | conv4 | provenance | |
10-
| test.cpp:72:25:72:34 | call to localeconv | test.cpp:76:5:76:8 | conv | provenance | |
11+
| test.cpp:64:3:64:22 | ... = ... | test.cpp:67:5:67:9 | conv4 | provenance | |
12+
| test.cpp:64:11:64:20 | call to localeconv | test.cpp:64:3:64:22 | ... = ... | provenance | |
13+
| test.cpp:72:25:72:34 | call to localeconv | test.cpp:72:25:72:34 | call to localeconv | provenance | |
14+
| test.cpp:72:25:72:34 | call to localeconv | test.cpp:73:24:73:28 | conv4 | provenance | |
15+
| test.cpp:73:24:73:28 | conv4 | test.cpp:76:5:76:8 | conv | provenance | |
1116
nodes
1217
| test.cpp:8:18:8:22 | c_str | semmle.label | c_str |
13-
| test.cpp:11:8:11:12 | c_str | semmle.label | c_str |
18+
| test.cpp:11:7:11:12 | * ... | semmle.label | * ... |
19+
| test.cpp:18:16:18:21 | call to getenv | semmle.label | call to getenv |
1420
| test.cpp:18:16:18:21 | call to getenv | semmle.label | call to getenv |
1521
| test.cpp:24:9:24:12 | env1 | semmle.label | env1 |
22+
| test.cpp:64:3:64:22 | ... = ... | semmle.label | ... = ... |
1623
| test.cpp:64:11:64:20 | call to localeconv | semmle.label | call to localeconv |
1724
| test.cpp:67:5:67:9 | conv4 | semmle.label | conv4 |
1825
| test.cpp:72:25:72:34 | call to localeconv | semmle.label | call to localeconv |
26+
| test.cpp:72:25:72:34 | call to localeconv | semmle.label | call to localeconv |
27+
| test.cpp:73:24:73:28 | conv4 | semmle.label | conv4 |
1928
| test.cpp:76:5:76:8 | conv | semmle.label | conv |
2029
subpaths

0 commit comments

Comments
 (0)