Skip to content

Commit a4c2246

Browse files
committed
Rust: Use TaintFlow instead of ValueFlow in tests
1 parent b1ed72d commit a4c2246

File tree

9 files changed

+191
-71
lines changed

9 files changed

+191
-71
lines changed

rust/ql/test/library-tests/dataflow/barrier/inline-flow.ql

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
import rust
66
import utils.test.InlineFlowTest
77
import DefaultFlowTest
8-
import ValueFlow::PathGraph
8+
import TaintFlow::PathGraph
99

10-
from ValueFlow::PathNode source, ValueFlow::PathNode sink
11-
where ValueFlow::flowPath(source, sink)
10+
from TaintFlow::PathNode source, TaintFlow::PathNode sink
11+
where TaintFlow::flowPath(source, sink)
1212
select sink, source, sink, "$@", source, source.toString()

rust/ql/test/library-tests/dataflow/global/inline-flow.expected

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,13 @@ edges
154154
| main.rs:272:27:272:28 | &a [&ref, MyInt] | main.rs:235:14:235:18 | SelfParam [&ref, MyInt] | provenance | |
155155
| main.rs:272:27:272:28 | &a [&ref, MyInt] | main.rs:272:14:272:29 | ...::deref(...) [&ref] | provenance | |
156156
| main.rs:272:28:272:28 | a [MyInt] | main.rs:272:27:272:28 | &a [&ref, MyInt] | provenance | |
157+
| main.rs:275:9:275:9 | a [MyInt] | main.rs:276:14:276:14 | a [MyInt] | provenance | |
158+
| main.rs:275:13:275:39 | MyInt {...} [MyInt] | main.rs:275:9:275:9 | a [MyInt] | provenance | |
159+
| main.rs:275:28:275:37 | source(...) | main.rs:275:13:275:39 | MyInt {...} [MyInt] | provenance | |
160+
| main.rs:276:9:276:9 | c [&ref] | main.rs:277:10:277:10 | c | provenance | |
161+
| main.rs:276:13:276:14 | * ... [&ref] | main.rs:276:9:276:9 | c [&ref] | provenance | |
162+
| main.rs:276:14:276:14 | a [MyInt] | main.rs:235:14:235:18 | SelfParam [&ref, MyInt] | provenance | |
163+
| main.rs:276:14:276:14 | a [MyInt] | main.rs:276:13:276:14 | * ... [&ref] | provenance | |
157164
| main.rs:289:18:289:21 | SelfParam [MyInt] | main.rs:289:48:291:5 | { ... } [MyInt] | provenance | |
158165
| main.rs:293:26:293:37 | ...: MyInt [MyInt] | main.rs:293:49:295:5 | { ... } [MyInt] | provenance | |
159166
| main.rs:299:9:299:9 | a [MyInt] | main.rs:301:50:301:50 | a [MyInt] | provenance | |
@@ -349,6 +356,13 @@ nodes
349356
| main.rs:272:27:272:28 | &a [&ref, MyInt] | semmle.label | &a [&ref, MyInt] |
350357
| main.rs:272:28:272:28 | a [MyInt] | semmle.label | a [MyInt] |
351358
| main.rs:273:10:273:10 | c | semmle.label | c |
359+
| main.rs:275:9:275:9 | a [MyInt] | semmle.label | a [MyInt] |
360+
| main.rs:275:13:275:39 | MyInt {...} [MyInt] | semmle.label | MyInt {...} [MyInt] |
361+
| main.rs:275:28:275:37 | source(...) | semmle.label | source(...) |
362+
| main.rs:276:9:276:9 | c [&ref] | semmle.label | c [&ref] |
363+
| main.rs:276:13:276:14 | * ... [&ref] | semmle.label | * ... [&ref] |
364+
| main.rs:276:14:276:14 | a [MyInt] | semmle.label | a [MyInt] |
365+
| main.rs:277:10:277:10 | c | semmle.label | c |
352366
| main.rs:289:18:289:21 | SelfParam [MyInt] | semmle.label | SelfParam [MyInt] |
353367
| main.rs:289:48:291:5 | { ... } [MyInt] | semmle.label | { ... } [MyInt] |
354368
| main.rs:293:26:293:37 | ...: MyInt [MyInt] | semmle.label | ...: MyInt [MyInt] |
@@ -397,6 +411,7 @@ subpaths
397411
| main.rs:252:9:252:9 | a [MyInt] | main.rs:220:12:220:15 | SelfParam [MyInt] | main.rs:220:42:223:5 | { ... } [MyInt] | main.rs:254:13:254:20 | a.add(...) [MyInt] |
398412
| main.rs:261:35:261:35 | b [MyInt] | main.rs:227:30:227:39 | ...: MyInt [MyInt] | main.rs:227:19:227:27 | SelfParam [Return] [&ref, MyInt] | main.rs:261:27:261:32 | [post] &mut a [&ref, MyInt] |
399413
| main.rs:272:27:272:28 | &a [&ref, MyInt] | main.rs:235:14:235:18 | SelfParam [&ref, MyInt] | main.rs:235:38:237:5 | { ... } [&ref] | main.rs:272:14:272:29 | ...::deref(...) [&ref] |
414+
| main.rs:276:14:276:14 | a [MyInt] | main.rs:235:14:235:18 | SelfParam [&ref, MyInt] | main.rs:235:38:237:5 | { ... } [&ref] | main.rs:276:13:276:14 | * ... [&ref] |
400415
| main.rs:301:50:301:50 | a [MyInt] | main.rs:289:18:289:21 | SelfParam [MyInt] | main.rs:289:48:291:5 | { ... } [MyInt] | main.rs:301:30:301:54 | ...::take_self(...) [MyInt] |
401416
| main.rs:306:55:306:55 | b [MyInt] | main.rs:293:26:293:37 | ...: MyInt [MyInt] | main.rs:293:49:295:5 | { ... } [MyInt] | main.rs:306:30:306:56 | ...::take_second(...) [MyInt] |
402417
testFailures
@@ -424,6 +439,7 @@ testFailures
424439
| main.rs:255:10:255:16 | d.value | main.rs:252:28:252:36 | source(...) | main.rs:255:10:255:16 | d.value | $@ | main.rs:252:28:252:36 | source(...) | source(...) |
425440
| main.rs:262:10:262:16 | a.value | main.rs:259:28:259:37 | source(...) | main.rs:262:10:262:16 | a.value | $@ | main.rs:259:28:259:37 | source(...) | source(...) |
426441
| main.rs:273:10:273:10 | c | main.rs:270:28:270:37 | source(...) | main.rs:273:10:273:10 | c | $@ | main.rs:270:28:270:37 | source(...) | source(...) |
442+
| main.rs:277:10:277:10 | c | main.rs:275:28:275:37 | source(...) | main.rs:277:10:277:10 | c | $@ | main.rs:275:28:275:37 | source(...) | source(...) |
427443
| main.rs:302:10:302:10 | c | main.rs:299:28:299:36 | source(...) | main.rs:302:10:302:10 | c | $@ | main.rs:299:28:299:36 | source(...) | source(...) |
428444
| main.rs:307:10:307:10 | c | main.rs:305:28:305:37 | source(...) | main.rs:307:10:307:10 | c | $@ | main.rs:305:28:305:37 | source(...) | source(...) |
429445
| main.rs:317:10:317:10 | a | main.rs:316:13:316:21 | source(...) | main.rs:317:10:317:10 | a | $@ | main.rs:316:13:316:21 | source(...) | source(...) |

rust/ql/test/library-tests/dataflow/global/inline-flow.ql

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
import rust
66
import utils.test.InlineFlowTest
77
import DefaultFlowTest
8-
import ValueFlow::PathGraph
8+
import TaintFlow::PathGraph
99

10-
from ValueFlow::PathNode source, ValueFlow::PathNode sink
11-
where ValueFlow::flowPath(source, sink)
10+
from TaintFlow::PathNode source, TaintFlow::PathNode sink
11+
where TaintFlow::flowPath(source, sink)
1212
select sink, source, sink, "$@", source, source.toString()

rust/ql/test/library-tests/dataflow/lambdas/inline-flow.ql

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
import rust
66
import utils.test.InlineFlowTest
77
import DefaultFlowTest
8-
import ValueFlow::PathGraph
8+
import TaintFlow::PathGraph
99

10-
from ValueFlow::PathNode source, ValueFlow::PathNode sink
11-
where ValueFlow::flowPath(source, sink)
10+
from TaintFlow::PathNode source, TaintFlow::PathNode sink
11+
where TaintFlow::flowPath(source, sink)
1212
select sink, source, sink, "$@", source, source.toString()

0 commit comments

Comments
 (0)