File tree Expand file tree Collapse file tree 2 files changed +9
-7
lines changed
library-tests/dataflow/barrier Expand file tree Collapse file tree 2 files changed +9
-7
lines changed Original file line number Diff line number Diff line change 1
1
models
2
2
edges
3
3
nodes
4
+ | main.rs:17:10:17:18 | CallExpr | semmle.label | CallExpr |
4
5
subpaths
5
6
testFailures
6
- | main.rs:17:22:17:40 | Comment | Missing result: hasValueFlow=1 |
7
7
| main.rs:22:14:22:32 | Comment | Missing result: hasValueFlow=1 |
8
8
| main.rs:33:14:33:32 | Comment | Missing result: hasValueFlow=1 |
9
9
#select
10
+ | main.rs:17:10:17:18 | CallExpr | main.rs:17:10:17:18 | CallExpr | main.rs:17:10:17:18 | CallExpr | $@ | main.rs:17:10:17:18 | CallExpr | CallExpr |
Original file line number Diff line number Diff line change @@ -10,15 +10,16 @@ private import codeql.rust.dataflow.internal.DataFlowImpl
10
10
private import codeql.rust.dataflow.internal.TaintTrackingImpl
11
11
private import internal.InlineExpectationsTestImpl as InlineExpectationsTestImpl
12
12
13
+ // Holds if the target expression of `call` is a path and the string representation of the path is `name`.
14
+ private predicate callTargetName ( CallExpr call , string name ) {
15
+ call .getExpr ( ) .( PathExpr ) .getPath ( ) .toString ( ) = name
16
+ }
17
+
13
18
private module FlowTestImpl implements InputSig< Location , RustDataFlow > {
14
- predicate defaultSource ( DataFlow:: Node source ) {
15
- source .asExpr ( ) .( CallExpr ) .getExpr ( ) .toString ( ) = "source"
16
- }
19
+ predicate defaultSource ( DataFlow:: Node source ) { callTargetName ( source .asExpr ( ) , "source" ) }
17
20
18
21
predicate defaultSink ( DataFlow:: Node sink ) {
19
- any ( CallExpr call | call = sink .asExpr ( ) and call .getExpr ( ) .toString ( ) = "sink" )
20
- .getArgList ( )
21
- .getAnArg ( ) = sink .asExpr ( )
22
+ any ( CallExpr call | callTargetName ( call , "sink" ) ) .getArgList ( ) .getAnArg ( ) = sink .asExpr ( )
22
23
}
23
24
24
25
private string getSourceArgString ( DataFlow:: Node src ) {
You can’t perform that action at this time.
0 commit comments