mirror of
https://github.com/github/codeql.git
synced 2026-04-30 11:15:13 +02:00
cache a bit more (again)
This commit is contained in:
@@ -18,7 +18,11 @@ abstract class AstNode extends AstNode_ {
|
||||
* NOTE: For some statements and other purely syntactic elements,
|
||||
* there may not be a `ControlFlowNode`
|
||||
*/
|
||||
ControlFlowNode getAFlowNode() { py_flow_bb_node(result, this, _, _) }
|
||||
cached
|
||||
ControlFlowNode getAFlowNode() {
|
||||
Stages::AST::ref() and
|
||||
py_flow_bb_node(result, this, _, _)
|
||||
}
|
||||
|
||||
/** Gets the location for this AST node */
|
||||
cached
|
||||
|
||||
@@ -194,7 +194,9 @@ class ControlFlowNode extends @py_flow_node {
|
||||
BasicBlock getBasicBlock() { result.contains(this) }
|
||||
|
||||
/** Gets the scope containing this flow node */
|
||||
cached
|
||||
Scope getScope() {
|
||||
Stages::AST::ref() and
|
||||
if this.getNode() instanceof Scope
|
||||
then
|
||||
/* Entry or exit node */
|
||||
|
||||
@@ -76,8 +76,12 @@ module Stages {
|
||||
or
|
||||
exists(any(AstExtended::AstNode n).getParentNode())
|
||||
or
|
||||
exists(any(AstExtended::AstNode n).getAFlowNode())
|
||||
or
|
||||
exists(any(PyFlow::BasicBlock b).getImmediateDominator())
|
||||
or
|
||||
exists(any(PyFlow::BasicBlock b).getScope())
|
||||
or
|
||||
any(PyFlow::BasicBlock b).strictlyDominates(_)
|
||||
or
|
||||
any(PyFlow::BasicBlock b).strictlyReaches(_)
|
||||
@@ -141,7 +145,6 @@ module Stages {
|
||||
private import semmle.python.objects.TObject as TObject
|
||||
private import semmle.python.Flow as Flow
|
||||
private import semmle.python.objects.ObjectInternal as ObjectInternal
|
||||
private import semmle.python.objects.ObjectAPI as ObjectAPI
|
||||
private import semmle.python.pointsto.PointsTo as PointsTo
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user