Skip to content

Commit c56a325

Browse files
committed
Rust: remove now unneeded get(Arg|Param)List in the dataflow guide
1 parent e1e34df commit c56a325

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

docs/codeql/codeql-language-guides/analyzing-data-flow-in-rust.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ This query finds the argument passed in each call to ``File::create``:
112112
113113
from CallExpr call
114114
where call.getStaticTarget().(Function).getCanonicalPath() = "<std::fs::File>::create"
115-
select call.getArgList().getArg(0)
115+
select call.getArg(0)
116116
117117
Unfortunately this will only give the expression in the argument, not the values which could be passed to it.
118118
So we use local data flow to find all expressions that flow into the argument:
@@ -125,7 +125,7 @@ So we use local data flow to find all expressions that flow into the argument:
125125
from CallExpr call, DataFlow::ExprNode source, DataFlow::ExprNode sink
126126
where
127127
call.getStaticTarget().(Function).getCanonicalPath() = "<std::fs::File>::create" and
128-
sink.asExpr().getExpr() = call.getArgList().getArg(0) and
128+
sink.asExpr().getExpr() = call.getArg(0) and
129129
DataFlow::localFlow(source, sink)
130130
select source, sink
131131
@@ -139,7 +139,7 @@ We can vary the source, for example, making the source the parameter of a functi
139139
from CallExpr call, DataFlow::ParameterNode source, DataFlow::ExprNode sink
140140
where
141141
call.getStaticTarget().(Function).getCanonicalPath() = "<std::fs::File>::create" and
142-
sink.asExpr().getExpr() = call.getArgList().getArg(0) and
142+
sink.asExpr().getExpr() = call.getArg(0) and
143143
DataFlow::localFlow(source, sink)
144144
select source, sink
145145
@@ -234,9 +234,9 @@ The following global taint-tracking query finds places where a string literal is
234234
predicate isSink(DataFlow::Node node) {
235235
// any argument going to a parameter called `password`
236236
exists(Function f, CallExpr call, int index |
237-
call.getArgList().getArg(index) = node.asExpr().getExpr() and
237+
call.getArg(index) = node.asExpr().getExpr() and
238238
call.getStaticTarget() = f and
239-
f.getParamList().getParam(index).getPat().(IdentPat).getName().getText() = "password"
239+
f.getParam(index).getPat().(IdentPat).getName().getText() = "password"
240240
)
241241
}
242242
}

0 commit comments

Comments
 (0)