Skip to content

Commit dcb24e0

Browse files
committed
C++: Remove getFullyConverted call in sink def
With this change, the `IRDataflowTestCommon.qll` and `DataflowTestCommon.qll` files use the same definitions of sources and sinks. Since the IR data flow library is meant to be compatible with the AST data flow library, this is what we ought to be testing. Two alerts change but not necessarily for the right reasons.
1 parent 502b7cf commit dcb24e0

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

cpp/ql/test/library-tests/dataflow/dataflow-tests/IRDataflowTestCommon.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class TestAllocationConfig extends DataFlow::Configuration {
1919
override predicate isSink(DataFlow::Node sink) {
2020
exists(FunctionCall call |
2121
call.getTarget().getName() = "sink" and
22-
sink.asExpr() = call.getAnArgument().getFullyConverted()
22+
sink.asExpr() = call.getAnArgument()
2323
)
2424
}
2525

cpp/ql/test/library-tests/dataflow/dataflow-tests/test_diff.expected

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
| test.cpp:66:30:66:36 | test.cpp:71:8:71:9 | AST only |
2-
| test.cpp:89:28:89:34 | test.cpp:90:8:90:14 | AST only |
2+
| test.cpp:89:28:89:34 | test.cpp:92:8:92:14 | IR only |
33
| test.cpp:100:13:100:18 | test.cpp:103:10:103:12 | AST only |
44
| test.cpp:120:9:120:20 | test.cpp:126:8:126:19 | AST only |
55
| test.cpp:122:18:122:30 | test.cpp:132:22:132:23 | IR only |

cpp/ql/test/library-tests/dataflow/dataflow-tests/test_ir.expected

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
| test.cpp:76:8:76:9 | Load: u1 | test.cpp:75:7:75:8 | Uninitialized: definition of u1 |
1010
| test.cpp:84:8:84:18 | Load: ... ? ... : ... | test.cpp:83:7:83:8 | Uninitialized: definition of u2 |
1111
| test.cpp:86:8:86:9 | Load: i1 | test.cpp:83:7:83:8 | Uninitialized: definition of u2 |
12+
| test.cpp:90:8:90:14 | Load: source1 | test.cpp:89:28:89:34 | InitializeParameter: source1 |
13+
| test.cpp:92:8:92:14 | Load: source1 | test.cpp:89:28:89:34 | InitializeParameter: source1 |
1214
| test.cpp:132:22:132:23 | Load: m1 | test.cpp:122:18:122:30 | InitializeParameter: sourceStruct1 |
1315
| test.cpp:140:22:140:23 | Load: m1 | test.cpp:122:18:122:30 | InitializeParameter: sourceStruct1 |
1416
| test.cpp:188:8:188:8 | Load: y | test.cpp:186:27:186:32 | Call: call to source |

0 commit comments

Comments
 (0)