mirror of
https://github.com/github/codeql.git
synced 2025-12-18 01:33:15 +01:00
Merge pull request #8147 from erik-krogh/cacheReg
JS: cache RegExpCreationNode::getAReference
This commit is contained in:
@@ -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())
|
||||
}
|
||||
}
|
||||
|
||||
@@ -238,6 +238,8 @@ module Stages {
|
||||
1 = 1
|
||||
or
|
||||
DataFlow::SharedFlowStep::step(_, _)
|
||||
or
|
||||
exists(any(DataFlow::RegExpCreationNode e).getAReference())
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user