Merge pull request #8147 from erik-krogh/cacheReg

JS: cache RegExpCreationNode::getAReference
This commit is contained in:
Erik Krogh Kristensen
2022-05-04 16:25:25 +02:00
committed by GitHub
2 changed files with 7 additions and 1 deletions

View File

@@ -1684,5 +1684,9 @@ class RegExpCreationNode extends DataFlow::SourceNode {
}
/** Gets a data flow node referring to this regular expression. */
DataFlow::SourceNode getAReference() { result = this.getAReference(DataFlow::TypeTracker::end()) }
cached
DataFlow::SourceNode getAReference() {
Stages::FlowSteps::ref() and
result = this.getAReference(DataFlow::TypeTracker::end())
}
}

View File

@@ -238,6 +238,8 @@ module Stages {
1 = 1
or
DataFlow::SharedFlowStep::step(_, _)
or
exists(any(DataFlow::RegExpCreationNode e).getAReference())
}
}