@@ -183,6 +183,18 @@ module LocalFlow {
183
183
}
184
184
185
185
predicate localFlowStepCommon ( Node nodeFrom , Node nodeTo ) {
186
+ exists ( DataFlowCallable c | nodeFrom = TSynthHashSplatParameterNode ( c ) |
187
+ exists ( HashSplatParameter p |
188
+ p .getCallable ( ) = c .asCallable ( ) and
189
+ nodeTo = TNormalParameterNode ( p )
190
+ )
191
+ or
192
+ exists ( ParameterPosition pos |
193
+ nodeTo = TSummaryParameterNode ( c .asLibraryCallable ( ) , pos ) and
194
+ pos .isHashSplat ( )
195
+ )
196
+ )
197
+ or
186
198
localSsaFlowStep ( nodeFrom , nodeTo )
187
199
or
188
200
nodeFrom .asExpr ( ) = nodeTo .asExpr ( ) .( CfgNodes:: ExprNodes:: BlockArgumentCfgNode ) .getValue ( )
@@ -620,7 +632,9 @@ private module ParameterNodes {
620
632
)
621
633
or
622
634
parameter = callable .getAParameter ( ) .( HashSplatParameter ) and
623
- pos .isHashSplat ( )
635
+ pos .isHashSplat ( ) and
636
+ // avoid overlap with `SynthHashSplatParameterNode`
637
+ not callable .getAParameter ( ) instanceof KeywordParameter
624
638
or
625
639
parameter = callable .getParameter ( 0 ) .( SplatParameter ) and
626
640
pos .isSplatAll ( )
@@ -772,7 +786,16 @@ private module ParameterNodes {
772
786
override Parameter getParameter ( ) { none ( ) }
773
787
774
788
override predicate isParameterOf ( DataFlowCallable c , ParameterPosition pos ) {
775
- sc = c .asLibraryCallable ( ) and pos = pos_
789
+ sc = c .asLibraryCallable ( ) and
790
+ pos = pos_ and
791
+ // avoid overlap with `SynthHashSplatParameterNode`
792
+ not (
793
+ pos .isHashSplat ( ) and
794
+ exists ( ParameterPosition keywordPos |
795
+ FlowSummaryImpl:: Private:: summaryParameterNodeRange ( sc , keywordPos ) and
796
+ keywordPos .isKeyword ( _)
797
+ )
798
+ )
776
799
}
777
800
778
801
override CfgScope getCfgScope ( ) { none ( ) }
@@ -1174,11 +1197,11 @@ predicate clearsContent(Node n, ContentSet c) {
1174
1197
// Filter out keyword arguments that are part of the method signature from
1175
1198
// the hash-splat parameter
1176
1199
exists (
1177
- DataFlowCallable callable , ParameterPosition hashSplatPos , ParameterNodeImpl keywordParam ,
1200
+ DataFlowCallable callable , HashSplatParameter hashSplatParam , ParameterNodeImpl keywordParam ,
1178
1201
ParameterPosition keywordPos , string name
1179
1202
|
1180
- n . ( ParameterNodes :: NormalParameterNode ) . isParameterOf ( callable , hashSplatPos ) and
1181
- hashSplatPos . isHashSplat ( ) and
1203
+ n = TNormalParameterNode ( hashSplatParam ) and
1204
+ callable . asCallable ( ) = hashSplatParam . getCallable ( ) and
1182
1205
keywordParam .isParameterOf ( callable , keywordPos ) and
1183
1206
keywordPos .isKeyword ( name ) and
1184
1207
c = getKeywordContent ( name )
0 commit comments