mirror of
https://github.com/github/codeql.git
synced 2026-04-26 17:25:19 +02:00
JS: Cache getARead (as per instructions in the SSA library)
This commit is contained in:
@@ -66,6 +66,16 @@ module SsaDataflowInput implements DataFlowIntegrationInputSig {
|
||||
|
||||
predicate ssaDefInitializesParam(WriteDefinition def, Parameter p) { none() } // Not handled here
|
||||
|
||||
cached
|
||||
Expr getARead(Definition def) {
|
||||
// Copied from implementation so we can cache it here
|
||||
exists(SsaConfig::SourceVariable v, js::BasicBlock bb, int i |
|
||||
ssaDefReachesRead(v, def, bb, i) and
|
||||
SsaConfig::variableRead(bb, i, v, true) and
|
||||
result.hasCfgNode(bb, i)
|
||||
)
|
||||
}
|
||||
|
||||
class Guard extends js::ControlFlowNode {
|
||||
Guard() { this = any(js::ConditionGuardNode g).getTest() }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user