Skip to content

Commit 5615916

Browse files
committed
Ruby: Remove spurious parent-child edges for Ruby::SimpleSymbol.
These treesitter nodes translate to multiple AstNodes, but we only want those that are Stmts.
1 parent ea0278e commit 5615916

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

ruby/ql/lib/codeql/ruby/ast/internal/Synthesis.qll

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1974,9 +1974,12 @@ private module CallableBodySynthesis {
19741974
i = 0 and
19751975
child = SynthChild(BodyStmtKind())
19761976
or
1977-
parent = TBodyStmtSynth(m, 0) and
1978-
i = 0 and
1979-
child = childRef(fromGenerated(body))
1977+
exists(Stmt bodyStmt |
1978+
parent = TBodyStmtSynth(m, 0) and
1979+
i = 0 and
1980+
bodyStmt = fromGenerated(body) and
1981+
child = childRef(bodyStmt)
1982+
)
19801983
)
19811984
}
19821985

0 commit comments

Comments
 (0)