@@ -8,7 +8,6 @@ private import codeql.util.Boolean
88private import codeql.dataflow.DataFlow
99private import codeql.dataflow.internal.DataFlowImpl
1010private import rust
11- private import codeql.rust.elements.Call
1211private import SsaImpl as SsaImpl
1312private import codeql.rust.controlflow.internal.Scope as Scope
1413private import codeql.rust.internal.PathResolution
@@ -58,7 +57,7 @@ final class DataFlowCallable extends TDataFlowCallable {
5857
5958final class DataFlowCall extends TDataFlowCall {
6059 /** Gets the underlying function call, if any. */
61- FunctionCall asFunctionCall ( ) { this = TFunctionCall ( result ) }
60+ CallExpr asCallExpr ( ) { this = TCallExpr ( result ) }
6261
6362 predicate isSummaryCall (
6463 FlowSummaryImpl:: Public:: SummarizedCallable c , FlowSummaryImpl:: Private:: SummaryNode receiver
@@ -67,13 +66,13 @@ final class DataFlowCall extends TDataFlowCall {
6766 }
6867
6968 DataFlowCallable getEnclosingCallable ( ) {
70- result .asCfgScope ( ) = this .asFunctionCall ( ) .getEnclosingCfgScope ( )
69+ result .asCfgScope ( ) = this .asCallExpr ( ) .getEnclosingCfgScope ( )
7170 or
7271 this .isSummaryCall ( result .asSummarizedCallable ( ) , _)
7372 }
7473
7574 string toString ( ) {
76- result = this .asFunctionCall ( ) .toString ( )
75+ result = this .asCallExpr ( ) .toString ( )
7776 or
7877 exists (
7978 FlowSummaryImpl:: Public:: SummarizedCallable c , FlowSummaryImpl:: Private:: SummaryNode receiver
@@ -83,7 +82,7 @@ final class DataFlowCall extends TDataFlowCall {
8382 )
8483 }
8584
86- Location getLocation ( ) { result = this .asFunctionCall ( ) .getLocation ( ) }
85+ Location getLocation ( ) { result = this .asCallExpr ( ) .getLocation ( ) }
8786}
8887
8988/**
@@ -131,7 +130,7 @@ final class ParameterPosition extends TParameterPosition {
131130 */
132131final class ArgumentPosition extends ParameterPosition {
133132 /** Gets the argument of `call` at this position, if any. */
134- Expr getArgument ( Call call ) {
133+ Expr getArgument ( CallExpr call ) {
135134 result = call .getArgument ( this .getPosition ( ) )
136135 or
137136 this .isSelf ( ) and result = call .getReceiver ( )
@@ -141,7 +140,7 @@ final class ArgumentPosition extends ParameterPosition {
141140/**
142141 * Holds if `arg` is an argument of `call` at the position `pos`.
143142 */
144- predicate isArgumentForCall ( Expr arg , FunctionCall call , ArgumentPosition pos ) {
143+ predicate isArgumentForCall ( Expr arg , CallExpr call , ArgumentPosition pos ) {
145144 arg = pos .getArgument ( call )
146145}
147146
@@ -291,8 +290,8 @@ predicate lambdaCreationExpr(Expr creation) {
291290 * Holds if `call` is a lambda call of kind `kind` where `receiver` is the
292291 * invoked expression.
293292 */
294- predicate lambdaCallExpr ( ClosureCall call , LambdaCallKind kind , Expr receiver ) {
295- receiver = call .getFunction ( ) and
293+ predicate lambdaCallExpr ( ClosureCallExpr call , LambdaCallKind kind , Expr receiver ) {
294+ receiver = call .getClosureExpr ( ) and
296295 exists ( kind )
297296}
298297
@@ -402,7 +401,7 @@ module RustDataFlow implements InputSig<Location> {
402401
403402 /** Gets a viable implementation of the target of the given `Call`. */
404403 DataFlowCallable viableCallable ( DataFlowCall call ) {
405- exists ( FunctionCall c | c = call .asFunctionCall ( ) |
404+ exists ( CallExpr c | c = call .asCallExpr ( ) |
406405 result .asCfgScope ( ) = c .getARuntimeTarget ( )
407406 or
408407 exists ( SummarizedCallable sc , Function staticTarget |
@@ -662,7 +661,7 @@ module RustDataFlow implements InputSig<Location> {
662661
663662 pragma [ nomagic]
664663 additional predicate storeContentStep ( Node node1 , Content c , Node node2 ) {
665- exists ( CallExpr call , int pos |
664+ exists ( ParenArgsExpr call , int pos |
666665 node1 .asExpr ( ) = call .getArgument ( pragma [ only_bind_into ] ( pos ) ) and
667666 node2 .asExpr ( ) = call and
668667 c = TTupleFieldContent ( call .getTupleField ( pragma [ only_bind_into ] ( pos ) ) )
@@ -814,7 +813,7 @@ module RustDataFlow implements InputSig<Location> {
814813 // pointer. Except if the path occurs directly in a call, then it's just a
815814 // call to the function and not a function being passed as data.
816815 resolvePath ( e .( PathExpr ) .getPath ( ) ) = c .asCfgScope ( ) and
817- not any ( CallExpr call ) .getFunction ( ) = e
816+ not any ( ParenArgsExpr call ) .getBase ( ) = e
818817 )
819818 }
820819
@@ -824,7 +823,7 @@ module RustDataFlow implements InputSig<Location> {
824823 */
825824 predicate lambdaCall ( DataFlowCall call , LambdaCallKind kind , Node receiver ) {
826825 (
827- receiver .asExpr ( ) = call .asFunctionCall ( ) .( ClosureCall ) . getFunction ( )
826+ receiver .asExpr ( ) = call .asCallExpr ( ) .( ClosureCallExpr ) . getClosureExpr ( )
828827 or
829828 call .isSummaryCall ( _, receiver .( FlowSummaryNode ) .getSummaryNode ( ) )
830829 ) and
@@ -986,7 +985,7 @@ private module Cached {
986985
987986 cached
988987 newtype TDataFlowCall =
989- TFunctionCall ( FunctionCall call ) {
988+ TCallExpr ( CallExpr call ) {
990989 Stages:: DataFlowStage:: ref ( ) and
991990 call .hasEnclosingCfgScope ( )
992991 } or
0 commit comments