@@ -452,9 +452,6 @@ private module Cached {
452452 exists ( c .asCallable ( ) ) and // exclude library callables
453453 isParameterNode ( _, c , any ( ParameterPosition p | p .isPositional ( _) ) )
454454 } or
455- TSynthSplatArgParameterNode ( DataFlowCallable c ) {
456- exists ( c .asCallable ( ) ) // exclude library callables
457- } or
458455 TSynthSplatParameterElementNode ( DataFlowCallable c , int n ) {
459456 exists ( c .asCallable ( ) ) and // exclude library callables
460457 isParameterNode ( _, c , any ( ParameterPosition p | p .isSplat ( _) ) ) and
@@ -486,7 +483,7 @@ private module Cached {
486483
487484 class TSourceParameterNode =
488485 TNormalParameterNode or TBlockParameterNode or TSelfParameterNode or
489- TSynthHashSplatParameterNode or TSynthSplatParameterNode or TSynthSplatArgParameterNode ;
486+ TSynthHashSplatParameterNode or TSynthSplatParameterNode ;
490487
491488 cached
492489 Location getLocation ( NodeImpl n ) { result = n .getLocationImpl ( ) }
@@ -694,8 +691,6 @@ predicate nodeIsHidden(Node n) {
694691 or
695692 n instanceof SynthSplatArgumentNode
696693 or
697- n instanceof SynthSplatArgParameterNode
698- or
699694 n instanceof SynthSplatParameterElementNode
700695 or
701696 n instanceof LambdaSelfReferenceNode
@@ -1087,31 +1082,6 @@ private module ParameterNodes {
10871082 final override string toStringImpl ( ) { result = "synthetic *args" }
10881083 }
10891084
1090- /**
1091- * A node that holds all positional arguments passed in a call to `c`.
1092- * This is a mirror of the `SynthSplatArgumentNode` on the callable side.
1093- * See `SynthSplatArgumentNode` for more information.
1094- */
1095- class SynthSplatArgParameterNode extends ParameterNodeImpl , TSynthSplatArgParameterNode {
1096- private DataFlowCallable callable ;
1097-
1098- SynthSplatArgParameterNode ( ) { this = TSynthSplatArgParameterNode ( callable ) }
1099-
1100- final override Parameter getParameter ( ) { none ( ) }
1101-
1102- final override predicate isParameterOf ( DataFlowCallable c , ParameterPosition pos ) {
1103- c = callable and pos .isSynthArgSplat ( )
1104- }
1105-
1106- final override CfgScope getCfgScope ( ) { result = callable .asCallable ( ) }
1107-
1108- final override DataFlowCallable getEnclosingCallable ( ) { result = callable }
1109-
1110- final override Location getLocationImpl ( ) { result = callable .getLocation ( ) }
1111-
1112- final override string toStringImpl ( ) { result = "synthetic *args" }
1113- }
1114-
11151085 /**
11161086 * A node that holds the content of a specific positional argument.
11171087 * See `SynthSplatArgumentNode` for more information.
@@ -1285,9 +1255,9 @@ module ArgumentNodes {
12851255 *
12861256 * 1. We want `3` to flow to `z[0]` and `4` to flow to `z[1]`. We model this by first storing all arguments
12871257 * in a synthetic argument node `SynthSplatArgumentNode` (see `storeStepCommon`).
1288- * 2. We match this to an analogous parameter node `SynthSplatArgParameterNode ` on the callee side
1258+ * 2. We match this to an analogous parameter node `SynthSplatParameterNode ` on the callee side
12891259 * (see `parameterMatch`).
1290- * 3. For each content element stored in the `SynthSplatArgParameterNode `, we add a read step to a separate
1260+ * 3. For each content element stored in the `SynthSplatParameterNode `, we add a read step to a separate
12911261 * `SynthSplatParameterElementNode`, which is parameterized by the element index (see `readStep`).
12921262 * 4. Finally, we add store steps from these `SynthSplatParameterElementNode`s to the real splat parameter node
12931263 * (see `storeStep`).
@@ -1638,12 +1608,12 @@ predicate readStepCommon(Node node1, ContentSet c, Node node2) {
16381608 // TODO: convert into the above form
16391609 synthSplatArgumentElementReadStep ( node1 , c , node2 )
16401610 or
1641- // read from SynthSplatArgParameterNode [n] to nth positional parameter
1642- exists ( SynthSplatArgParameterNode argParamNode , NormalParameterNode posNode , int n |
1643- argParamNode = node1 and
1611+ // read from SynthSplatParameterNode [n] to nth positional parameter
1612+ exists ( SynthSplatParameterNode paramNode , NormalParameterNode posNode , int n |
1613+ paramNode = node1 and
16441614 posNode = node2 and
16451615 posNode
1646- .isParameterOf ( argParamNode .getEnclosingCallable ( ) ,
1616+ .isParameterOf ( paramNode .getEnclosingCallable ( ) ,
16471617 any ( ParameterPosition p | p .isPositional ( n ) ) ) and
16481618 c = getPositionalContent ( n )
16491619 )
@@ -1655,6 +1625,7 @@ predicate synthSplatArgumentElementReadStep(
16551625) {
16561626 exists ( int splatPos , CfgNodes:: ExprNodes:: CallCfgNode call |
16571627 node1 .asExpr ( ) .( Argument ) .isArgumentOf ( call , any ( ArgumentPosition p | p .isSplat ( splatPos ) ) ) and
1628+ splatPos > 0 and
16581629 node2 .getCall ( ) = call and
16591630 (
16601631 exists ( int n |
@@ -1698,17 +1669,9 @@ predicate readStep(Node node1, ContentSet c, Node node2) {
16981669 FlowSummaryImpl:: Private:: Steps:: summaryReadStep ( node1 .( FlowSummaryNode ) .getSummaryNode ( ) , c ,
16991670 node2 .( FlowSummaryNode ) .getSummaryNode ( ) )
17001671 or
1701- // Read from SynthSplatArgParameterNode into SynthSplatParameterElementNode
1702- node2 =
1703- any ( SynthSplatParameterElementNode e |
1704- node1 .( SynthSplatArgParameterNode ) .isParameterOf ( e .getEnclosingCallable ( ) , _) and
1705- c = getPositionalContent ( e .getReadPosition ( ) )
1706- )
1707- or
17081672 VariableCapture:: readStep ( node1 , any ( Content:: CapturedVariableContent v | c .isSingleton ( v ) ) , node2 )
17091673 or
17101674 // Read from SynthSplatParameterNode into SynthSplatParameterElementNode
1711- // This models flow from elements in a splat argument to elements in a splat parameter, where there are preceding positional parameters.
17121675 node2 =
17131676 any ( SynthSplatParameterElementNode e |
17141677 node1 .( SynthSplatParameterNode ) .isParameterOf ( e .getEnclosingCallable ( ) , _) and
0 commit comments