mirror of
https://github.com/github/codeql.git
synced 2026-04-28 02:05:14 +02:00
cache AccessPath::getAnInstanceIn
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
*/
|
||||
|
||||
import javascript
|
||||
private import semmle.javascript.internal.CachedStages
|
||||
|
||||
/**
|
||||
* A representation of a property name that is either statically known or is
|
||||
@@ -88,7 +89,9 @@ class AccessPath extends TAccessPath {
|
||||
/**
|
||||
* Gets an expression in `bb` represented by this access path.
|
||||
*/
|
||||
cached
|
||||
Expr getAnInstanceIn(BasicBlock bb) {
|
||||
Stages::DataFlowStage::ref() and
|
||||
exists(SsaVariable var |
|
||||
this = MkSsaRoot(var) and
|
||||
result = getARefinementOf*(var).getAUseIn(bb)
|
||||
|
||||
@@ -24,6 +24,7 @@ import javascript
|
||||
private import StmtContainers
|
||||
private import semmle.javascript.dataflow.internal.PreCallGraphStep
|
||||
private import semmle.javascript.dataflow.internal.FlowSteps
|
||||
private import semmle.javascript.dataflow.internal.AccessPaths
|
||||
|
||||
/**
|
||||
* Contains a `cached module` for each stage.
|
||||
@@ -130,6 +131,8 @@ module Stages {
|
||||
any(DataFlow::Node node).hasLocationInfo(_, _, _, _, _)
|
||||
or
|
||||
exists(any(DataFlow::Node node).toString())
|
||||
or
|
||||
exists(any(AccessPath a).getAnInstanceIn(_))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user