cache RegExpCreationNode::getAReference

This commit is contained in:
Erik Krogh Kristensen
2022-02-16 09:56:48 +01:00
parent 02c4966109
commit cd4685c4c5
2 changed files with 7 additions and 1 deletions

View File

@@ -1650,5 +1650,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 {
AccessPath::DominatingPaths::hasDominatingWrite(_)
or
DataFlow::SharedFlowStep::step(_, _)
or
exists(any(DataFlow::RegExpCreationNode e).getAReference())
}
}