@@ -30,6 +30,19 @@ class FlowSummaryNode extends DataFlow::Node, TFlowSummaryNode {
3030 override string toString ( ) { result = this .getSummaryNode ( ) .toString ( ) }
3131}
3232
33+ class FlowSummaryDynamicParameterArrayNode extends DataFlow:: Node ,
34+ TFlowSummaryDynamicParameterArrayNode
35+ {
36+ private FlowSummaryImpl:: Public:: SummarizedCallable callable ;
37+
38+ FlowSummaryDynamicParameterArrayNode ( ) { this = TFlowSummaryDynamicParameterArrayNode ( callable ) }
39+
40+ FlowSummaryImpl:: Public:: SummarizedCallable getSummarizedCallable ( ) { result = callable }
41+
42+ cached
43+ override string toString ( ) { result = "[dynamic parameter array] " + callable }
44+ }
45+
3346class FlowSummaryIntermediateAwaitStoreNode extends DataFlow:: Node ,
3447 TFlowSummaryIntermediateAwaitStoreNode
3548{
@@ -342,6 +355,12 @@ private predicate isParameterNodeImpl(Node p, DataFlowCallable c, ParameterPosit
342355 FlowSummaryImpl:: Private:: summaryParameterNode ( summaryNode .getSummaryNode ( ) , pos ) and
343356 c .asLibraryCallable ( ) = summaryNode .getSummarizedCallable ( )
344357 )
358+ or
359+ exists ( FlowSummaryImpl:: Public:: SummarizedCallable callable |
360+ c .asLibraryCallable ( ) = callable and
361+ pos .isDynamicArgumentArray ( ) and
362+ p = TFlowSummaryDynamicParameterArrayNode ( callable )
363+ )
345364}
346365
347366predicate isParameterNode ( ParameterNode p , DataFlowCallable c , ParameterPosition pos ) {
@@ -410,6 +429,8 @@ DataFlowCallable nodeGetEnclosingCallable(Node node) {
410429 or
411430 result .asLibraryCallable ( ) = node .( FlowSummaryNode ) .getSummarizedCallable ( )
412431 or
432+ result .asLibraryCallable ( ) = node .( FlowSummaryDynamicParameterArrayNode ) .getSummarizedCallable ( )
433+ or
413434 result .asLibraryCallable ( ) = node .( FlowSummaryIntermediateAwaitStoreNode ) .getSummarizedCallable ( )
414435 or
415436 node = TGenericSynthesizedNode ( _, _, result )
@@ -1118,6 +1139,17 @@ predicate readStep(Node node1, ContentSet c, Node node2) {
11181139 storeContent .isUnknownArrayElement ( )
11191140 else storeContent .asArrayIndex ( ) = n + c .asArrayIndex ( )
11201141 )
1142+ or
1143+ exists ( FlowSummaryNode parameter , ParameterPosition pos |
1144+ FlowSummaryImpl:: Private:: summaryParameterNode ( parameter .getSummaryNode ( ) , pos ) and
1145+ node1 = TFlowSummaryDynamicParameterArrayNode ( parameter .getSummarizedCallable ( ) ) and
1146+ node2 = parameter and
1147+ (
1148+ c .asArrayIndex ( ) = pos .asPositional ( )
1149+ or
1150+ c = ContentSet:: arrayElementLowerBound ( pos .asPositionalLowerBound ( ) )
1151+ )
1152+ )
11211153}
11221154
11231155/** Gets the post-update node for which `node` is the corresponding pre-update node. */
0 commit comments