@@ -143,20 +143,30 @@ private module StepsInput implements Impl::Private::StepsInputSig {
143143 result .asCallBaseExprCfgNode ( ) .getCallExprBase ( ) = sc .( LibraryCallable ) .getACall ( )
144144 }
145145
146+ private Expr getArg ( CallExprBase call , ParameterPosition pos ) {
147+ result = call .getArgList ( ) .getArg ( pos .getPosition ( ) )
148+ or
149+ result = call .( MethodCallExpr ) .getReceiver ( ) and pos .isSelf ( )
150+ }
151+
146152 RustDataFlow:: Node getSourceNode ( Input:: SourceBase source , Impl:: Private:: SummaryComponent sc ) {
147153 sc = Impl:: Private:: SummaryComponent:: return ( _) and
148154 result .asExpr ( ) .getExpr ( ) = source .getCall ( )
155+ or
156+ exists ( CallExprBase call , Expr arg , ParameterPosition pos |
157+ result .( RustDataFlow:: PostUpdateNode ) .getPreUpdateNode ( ) .asExpr ( ) .getExpr ( ) = arg and
158+ sc = Impl:: Private:: SummaryComponent:: argument ( pos ) and
159+ call = source .getCall ( ) and
160+ arg = getArg ( call , pos )
161+ )
149162 }
150163
151164 RustDataFlow:: Node getSinkNode ( Input:: SinkBase sink , Impl:: Private:: SummaryComponent sc ) {
152165 exists ( CallExprBase call , Expr arg , ParameterPosition pos |
153166 result .asExpr ( ) .getExpr ( ) = arg and
154167 sc = Impl:: Private:: SummaryComponent:: argument ( pos ) and
155- call = sink .getCall ( )
156- |
157- arg = call .getArgList ( ) .getArg ( pos .getPosition ( ) )
158- or
159- arg = call .( MethodCallExpr ) .getReceiver ( ) and pos .isSelf ( )
168+ call = sink .getCall ( ) and
169+ arg = getArg ( call , pos )
160170 )
161171 }
162172}
0 commit comments