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 11models
22edges
33nodes
4+ | main.rs:17:10:17:18 | CallExpr | semmle.label | CallExpr |
45subpaths
56testFailures
6- | main.rs:17:22:17:40 | Comment | Missing result: hasValueFlow=1 |
77| main.rs:22:14:22:32 | Comment | Missing result: hasValueFlow=1 |
88| main.rs:33:14:33:32 | Comment | Missing result: hasValueFlow=1 |
99#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
1010private import codeql.rust.dataflow.internal.TaintTrackingImpl
1111private import internal.InlineExpectationsTestImpl as InlineExpectationsTestImpl
1212
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+
1318private 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" ) }
1720
1821 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 ( )
2223 }
2324
2425 private string getSourceArgString ( DataFlow:: Node src ) {
You can’t perform that action at this time.
0 commit comments