@@ -452,9 +452,6 @@ private module Cached {
452
452
exists ( c .asCallable ( ) ) and // exclude library callables
453
453
isParameterNode ( _, c , any ( ParameterPosition p | p .isPositional ( _) ) )
454
454
} or
455
- TSynthSplatArgParameterNode ( DataFlowCallable c ) {
456
- exists ( c .asCallable ( ) ) // exclude library callables
457
- } or
458
455
TSynthSplatParameterElementNode ( DataFlowCallable c , int n ) {
459
456
exists ( c .asCallable ( ) ) and // exclude library callables
460
457
isParameterNode ( _, c , any ( ParameterPosition p | p .isSplat ( _) ) ) and
@@ -486,7 +483,7 @@ private module Cached {
486
483
487
484
class TSourceParameterNode =
488
485
TNormalParameterNode or TBlockParameterNode or TSelfParameterNode or
489
- TSynthHashSplatParameterNode or TSynthSplatParameterNode or TSynthSplatArgParameterNode ;
486
+ TSynthHashSplatParameterNode or TSynthSplatParameterNode ;
490
487
491
488
cached
492
489
Location getLocation ( NodeImpl n ) { result = n .getLocationImpl ( ) }
@@ -694,8 +691,6 @@ predicate nodeIsHidden(Node n) {
694
691
or
695
692
n instanceof SynthSplatArgumentNode
696
693
or
697
- n instanceof SynthSplatArgParameterNode
698
- or
699
694
n instanceof SynthSplatParameterElementNode
700
695
or
701
696
n instanceof LambdaSelfReferenceNode
@@ -1087,31 +1082,6 @@ private module ParameterNodes {
1087
1082
final override string toStringImpl ( ) { result = "synthetic *args" }
1088
1083
}
1089
1084
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
-
1115
1085
/**
1116
1086
* A node that holds the content of a specific positional argument.
1117
1087
* See `SynthSplatArgumentNode` for more information.
@@ -1285,9 +1255,9 @@ module ArgumentNodes {
1285
1255
*
1286
1256
* 1. We want `3` to flow to `z[0]` and `4` to flow to `z[1]`. We model this by first storing all arguments
1287
1257
* 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
1289
1259
* (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
1291
1261
* `SynthSplatParameterElementNode`, which is parameterized by the element index (see `readStep`).
1292
1262
* 4. Finally, we add store steps from these `SynthSplatParameterElementNode`s to the real splat parameter node
1293
1263
* (see `storeStep`).
@@ -1638,12 +1608,12 @@ predicate readStepCommon(Node node1, ContentSet c, Node node2) {
1638
1608
// TODO: convert into the above form
1639
1609
synthSplatArgumentElementReadStep ( node1 , c , node2 )
1640
1610
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
1644
1614
posNode = node2 and
1645
1615
posNode
1646
- .isParameterOf ( argParamNode .getEnclosingCallable ( ) ,
1616
+ .isParameterOf ( paramNode .getEnclosingCallable ( ) ,
1647
1617
any ( ParameterPosition p | p .isPositional ( n ) ) ) and
1648
1618
c = getPositionalContent ( n )
1649
1619
)
@@ -1655,6 +1625,7 @@ predicate synthSplatArgumentElementReadStep(
1655
1625
) {
1656
1626
exists ( int splatPos , CfgNodes:: ExprNodes:: CallCfgNode call |
1657
1627
node1 .asExpr ( ) .( Argument ) .isArgumentOf ( call , any ( ArgumentPosition p | p .isSplat ( splatPos ) ) ) and
1628
+ splatPos > 0 and
1658
1629
node2 .getCall ( ) = call and
1659
1630
(
1660
1631
exists ( int n |
@@ -1698,17 +1669,9 @@ predicate readStep(Node node1, ContentSet c, Node node2) {
1698
1669
FlowSummaryImpl:: Private:: Steps:: summaryReadStep ( node1 .( FlowSummaryNode ) .getSummaryNode ( ) , c ,
1699
1670
node2 .( FlowSummaryNode ) .getSummaryNode ( ) )
1700
1671
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
1708
1672
VariableCapture:: readStep ( node1 , any ( Content:: CapturedVariableContent v | c .isSingleton ( v ) ) , node2 )
1709
1673
or
1710
1674
// 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.
1712
1675
node2 =
1713
1676
any ( SynthSplatParameterElementNode e |
1714
1677
node1 .( SynthSplatParameterNode ) .isParameterOf ( e .getEnclosingCallable ( ) , _) and
0 commit comments