Skip to content

Commit 9ff63b0

Browse files
committed
Ruby: Remove CFG dependency from AST stage
Commit 028ef6f had the unintended side-effect that the AST and CFG stages got merged, because the AST stage's `isCapturedAccess` now depends on `getCfgScopeImpl`, which belongs to the CFG stage. The fix is to remove `getCfgScopeImpl` from the CFG stage, and instead let it be part of the AST stage.
1 parent 08c7782 commit 9ff63b0

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

ruby/ql/lib/codeql/ruby/controlflow/internal/ControlFlowGraphImpl.qll

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1041,6 +1041,9 @@ private Scope parent(Scope n) {
10411041
not n instanceof CfgScope::Range_
10421042
}
10431043

1044+
cached
1045+
private CfgScope getCfgScopeImpl(AstNode n) { result = parent*(scopeOfInclSynth(n)) }
1046+
10441047
/** Gets the CFG scope of node `n`. */
10451048
pragma[inline]
10461049
CfgScope getCfgScope(AstNode n) {
@@ -1052,13 +1055,6 @@ CfgScope getCfgScope(AstNode n) {
10521055

10531056
cached
10541057
private module Cached {
1055-
/** Gets the CFG scope of node `n`. */
1056-
cached
1057-
CfgScope getCfgScopeImpl(AstNode n) {
1058-
forceCachingInSameStage() and
1059-
result = parent*(scopeOfInclSynth(n))
1060-
}
1061-
10621058
cached
10631059
newtype TSuccessorType =
10641060
TSuccessorSuccessor() or

0 commit comments

Comments
 (0)