@@ -62,6 +62,9 @@ final class DataFlowCall extends TDataFlowCall {
6262 /** Gets the underlying call, if any. */
6363 Call asCall ( ) { this = TCall ( result ) }
6464
65+ /** Gets the underlying await expression, if any. */
66+ AwaitExpr asAwaitExpr ( ) { this = TAwaitExpr ( result ) }
67+
6568 predicate isImplicitDerefCall ( Expr e , DerefChain derefChain , int i , Function target ) {
6669 this = TImplicitDerefCall ( e , derefChain , i , target )
6770 }
@@ -73,15 +76,16 @@ final class DataFlowCall extends TDataFlowCall {
7376 }
7477
7578 DataFlowCallable getEnclosingCallable ( ) {
76- result .asCfgScope ( ) = this .asCall ( ) .getEnclosingCfgScope ( )
79+ result .asCfgScope ( ) =
80+ [ this .asCall ( ) .getEnclosingCfgScope ( ) , this .asAwaitExpr ( ) .getEnclosingCfgScope ( ) ]
7781 or
7882 result .asCfgScope ( ) = any ( Expr e | this .isImplicitDerefCall ( e , _, _, _) ) .getEnclosingCfgScope ( )
7983 or
8084 this .isSummaryCall ( result .asSummarizedCallable ( ) , _)
8185 }
8286
8387 string toString ( ) {
84- result = this .asCall ( ) .toString ( )
88+ result = [ this .asCall ( ) .toString ( ) , this . asAwaitExpr ( ) . toString ( ) ]
8589 or
8690 exists ( Expr e , DerefChain derefChain , int i |
8791 this .isImplicitDerefCall ( e , derefChain , i , _) and
@@ -97,7 +101,7 @@ final class DataFlowCall extends TDataFlowCall {
97101 }
98102
99103 Location getLocation ( ) {
100- result = this .asCall ( ) .getLocation ( )
104+ result = [ this .asCall ( ) .getLocation ( ) , this . asAwaitExpr ( ) . getLocation ( ) ]
101105 or
102106 result = any ( Expr e | this .isImplicitDerefCall ( e , _, _, _) ) .getLocation ( )
103107 }
@@ -1004,7 +1008,11 @@ module RustDataFlowGen<RustDataFlowInputSig Input> implements InputSig<Location>
10041008 */
10051009 predicate lambdaCall ( DataFlowCall call , LambdaCallKind kind , Node receiver ) {
10061010 (
1007- receiver .asExpr ( ) = call .asCall ( ) .( CallExprImpl:: DynamicCallExpr ) .getFunction ( )
1011+ receiver .asExpr ( ) =
1012+ [
1013+ call .asCall ( ) .( CallExprImpl:: DynamicCallExpr ) .getFunction ( ) ,
1014+ call .asAwaitExpr ( ) .getExpr ( )
1015+ ]
10081016 or
10091017 call .isSummaryCall ( _, receiver .( FlowSummaryNode ) .getSummaryNode ( ) )
10101018 ) and
@@ -1176,6 +1184,7 @@ private module Cached {
11761184 Stages:: DataFlowStage:: ref ( ) and
11771185 call .hasEnclosingCfgScope ( )
11781186 } or
1187+ TAwaitExpr ( AwaitExpr await ) { await .hasEnclosingCfgScope ( ) } or
11791188 TImplicitDerefCall ( Expr e , DerefChain derefChain , int i , Function target ) {
11801189 TypeInference:: implicitDerefChainBorrow ( e , derefChain , _) and
11811190 target = derefChain .getElement ( i ) .getDerefFunction ( ) and
0 commit comments