@@ -250,6 +250,10 @@ module LocalFlow {
250
250
scope = e2 and
251
251
isSuccessor = true
252
252
or
253
+ e1 = e2 .( CollectionExpression ) .getAnElement ( ) .( SpreadElementExpr ) .getExpr ( ) and
254
+ scope = e2 and
255
+ isSuccessor = true
256
+ or
253
257
exists ( WithExpr we |
254
258
scope = we and
255
259
isSuccessor = true
@@ -738,6 +742,15 @@ private predicate fieldOrPropertyRead(Expr e1, Content c, FieldOrPropertyRead e2
738
742
)
739
743
}
740
744
745
+ /**
746
+ * Holds if `ce` is a collection expression that adds `src` to the collection `ce`.
747
+ */
748
+ private predicate collectionStore ( Expr src , CollectionExpression ce ) {
749
+ // Collection expression, `[1, src, 3]`
750
+ src = ce .getAnElement ( ) and
751
+ not src instanceof SpreadElementExpr
752
+ }
753
+
741
754
/**
742
755
* Holds if `e` is an expression that adds `src` to array `a`.
743
756
*
@@ -1799,6 +1812,11 @@ private class StoreStepConfiguration extends ControlFlowReachabilityConfiguratio
1799
1812
or
1800
1813
exactScope = false and
1801
1814
isSuccessor = true and
1815
+ collectionStore ( e1 , e2 ) and
1816
+ scope = e2
1817
+ or
1818
+ exactScope = false and
1819
+ isSuccessor = true and
1802
1820
isParamsArg ( e2 , e1 , _) and
1803
1821
scope = e2
1804
1822
}
@@ -1823,6 +1841,10 @@ predicate storeStep(Node node1, ContentSet c, Node node2) {
1823
1841
arrayStore ( _, node1 .asExpr ( ) , node .getExpr ( ) , postUpdate ) and c instanceof ElementContent
1824
1842
)
1825
1843
or
1844
+ exists ( StoreStepConfiguration x | hasNodePath ( x , node1 , node2 ) |
1845
+ collectionStore ( node1 .asExpr ( ) , node2 .asExpr ( ) ) and c instanceof ElementContent
1846
+ )
1847
+ or
1826
1848
exists ( StoreStepConfiguration x , Expr arg , ControlFlow:: Node callCfn |
1827
1849
x .hasExprPath ( arg , node1 .( ExprNode ) .getControlFlowNode ( ) , _, callCfn ) and
1828
1850
node2 = TParamsArgumentNode ( callCfn ) and
0 commit comments