@@ -187,10 +187,10 @@ module Node {
187187 * The value of a parameter at function entry, viewed as a node in a data
188188 * flow graph.
189189 */
190- final class NormalParameterNode extends ParameterNode , TParameterNode {
190+ final class PositionalParameterNode extends ParameterNode , TParameterNode {
191191 override ParamCfgNode n ;
192192
193- NormalParameterNode ( ) { this = TParameterNode ( n ) }
193+ PositionalParameterNode ( ) { this = TParameterNode ( n ) }
194194
195195 /** Gets the parameter in the CFG that this node corresponds to. */
196196 ParamCfgNode getParameter ( ) { result = n }
@@ -231,7 +231,7 @@ module Node {
231231 /** A data flow node that represents a value returned by a callable. */
232232 final class ReturnNode extends ExprNode {
233233 ReturnNode ( ) {
234- this .getCfgNode ( ) .getASuccessor ( ) instanceof ExitCfgNode or
234+ // this.getCfgNode().getASuccessor() instanceof ExitCfgNode or
235235 this .getCfgNode ( ) .getASuccessor ( ) instanceof AnnotatedExitCfgNode
236236 }
237237
@@ -270,11 +270,11 @@ module Node {
270270 /** Gets the node before the state update. */
271271 Node getPreUpdateNode ( ) { result = TExprNode ( n ) }
272272
273- final override CfgScope getCfgScope ( ) { result = n .getAstNode ( ) . getEnclosingCfgScope ( ) }
273+ final override CfgScope getCfgScope ( ) { result = n .getScope ( ) }
274274
275- final override Location getLocation ( ) { result = n .getAstNode ( ) . getLocation ( ) }
275+ final override Location getLocation ( ) { result = n .getLocation ( ) }
276276
277- final override string toString ( ) { result = n .getAstNode ( ) . toString ( ) }
277+ final override string toString ( ) { result = n .toString ( ) }
278278 }
279279
280280 final class CastNode = NaNode ;
@@ -287,7 +287,7 @@ module SsaFlow {
287287 private module SsaFlow = SsaImpl:: DataFlowIntegration;
288288
289289 private Node:: ParameterNode toParameterNode ( ParamCfgNode p ) {
290- result .( Node:: NormalParameterNode ) .getParameter ( ) = p
290+ result .( Node:: PositionalParameterNode ) .getParameter ( ) = p
291291 }
292292
293293 /** Converts a control flow node into an SSA control flow node. */
@@ -336,7 +336,8 @@ module LocalFlow {
336336 nodeFrom .( Node:: AstCfgFlowNode ) .getCfgNode ( ) =
337337 nodeTo .( Node:: SsaNode ) .getDefinitionExt ( ) .( Ssa:: WriteDefinition ) .getControlFlowNode ( )
338338 or
339- nodeFrom .( Node:: NormalParameterNode ) .getParameter ( ) .getPat ( ) = nodeTo .( Node:: PatNode ) .getPat ( )
339+ nodeFrom .( Node:: PositionalParameterNode ) .getParameter ( ) .getPat ( ) =
340+ nodeTo .( Node:: PatNode ) .getPat ( )
340341 or
341342 SsaFlow:: localFlowStep ( _, nodeFrom , nodeTo , _)
342343 or
@@ -376,7 +377,7 @@ module RustDataFlow implements InputSig<Location> {
376377
377378 /** Holds if `p` is a parameter of `c` at the position `pos`. */
378379 predicate isParameterNode ( ParameterNode p , DataFlowCallable c , ParameterPosition pos ) {
379- p .getCfgNode ( ) .getAstNode ( ) = pos .getParameterIn ( c .asCfgScope ( ) .( Function ) .getParamList ( ) )
380+ p .getCfgNode ( ) .getAstNode ( ) = pos .getParameterIn ( c .asCfgScope ( ) .( Callable ) .getParamList ( ) )
380381 }
381382
382383 /** Holds if `n` is an argument of `c` at the position `pos`. */
@@ -590,7 +591,7 @@ private module Cached {
590591 cached
591592 newtype TParameterPosition =
592593 TPositionalParameterPosition ( int i ) {
593- exists ( any ( ParamList l ) .getParam ( i ) ) or exists ( any ( ArgList l ) .getArg ( i ) )
594+ i in [ 0 .. max ( [ any ( ParamList l ) .getNumberOfParams ( ) , any ( ArgList l ) .getNumberOfArgs ( ) ] ) - 1 ]
594595 } or
595596 TSelfParameterPosition ( )
596597}
0 commit comments