change ArrayCreationStep to a PreCallGraphStep and unrestrict the storeStep

This commit is contained in:
Erik Krogh Kristensen
2021-12-01 23:20:56 +01:00
committed by erik-krogh
parent b944005046
commit 7b1ef7473e
6 changed files with 7 additions and 6 deletions

View File

@@ -261,14 +261,12 @@ private module ArrayDataFlow {
/**
* A step for creating an array and storing the elements in the array.
*/
private class ArrayCreationStep extends DataFlow::SharedFlowStep {
private class ArrayCreationStep extends PreCallGraphStep {
override predicate storeStep(DataFlow::Node element, DataFlow::SourceNode obj, string prop) {
exists(DataFlow::ArrayCreationNode array, int i |
element = array.getElement(i) and
obj = array and
if array = any(PromiseAllCreation c).getArrayNode()
then prop = arrayElement(i)
else prop = arrayElement()
prop = arrayElement(i)
)
}
}