@@ -58,7 +58,9 @@ module Input implements InputSig<Location, RustDataFlow> {
5858
5959 string encodeParameterPosition ( ParameterPosition pos ) { result = pos .toString ( ) }
6060
61- predicate encodeArgumentPosition = encodeParameterPosition / 1 ;
61+ string encodeArgumentPosition ( RustDataFlow:: ArgumentPosition pos ) {
62+ result = encodeParameterPosition ( pos )
63+ }
6264
6365 string encodeContent ( ContentSet cs , string arg ) {
6466 exists ( Content c | cs = TSingletonContentSet ( c ) |
@@ -143,30 +145,24 @@ private module StepsInput implements Impl::Private::StepsInputSig {
143145 result .asCallBaseExprCfgNode ( ) .getCallExprBase ( ) = sc .( LibraryCallable ) .getACall ( )
144146 }
145147
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-
152148 RustDataFlow:: Node getSourceNode ( Input:: SourceBase source , Impl:: Private:: SummaryComponent sc ) {
153149 sc = Impl:: Private:: SummaryComponent:: return ( _) and
154150 result .asExpr ( ) .getExpr ( ) = source .getCall ( )
155151 or
156- exists ( CallExprBase call , Expr arg , ParameterPosition pos |
152+ exists ( CallExprBase call , Expr arg , ArgumentPosition pos |
157153 result .( RustDataFlow:: PostUpdateNode ) .getPreUpdateNode ( ) .asExpr ( ) .getExpr ( ) = arg and
158154 sc = Impl:: Private:: SummaryComponent:: argument ( pos ) and
159155 call = source .getCall ( ) and
160- arg = getArg ( call , pos )
156+ arg = pos . getArgument ( call )
161157 )
162158 }
163159
164160 RustDataFlow:: Node getSinkNode ( Input:: SinkBase sink , Impl:: Private:: SummaryComponent sc ) {
165- exists ( CallExprBase call , Expr arg , ParameterPosition pos |
161+ exists ( CallExprBase call , Expr arg , ArgumentPosition pos |
166162 result .asExpr ( ) .getExpr ( ) = arg and
167163 sc = Impl:: Private:: SummaryComponent:: argument ( pos ) and
168164 call = sink .getCall ( ) and
169- arg = getArg ( call , pos )
165+ arg = pos . getArgument ( call )
170166 )
171167 }
172168}
0 commit comments