From 780591d42a67f6c30f1882fe36c54a6636dde2b3 Mon Sep 17 00:00:00 2001 From: Anders Schack-Mulligen Date: Tue, 26 May 2026 15:15:00 +0200 Subject: [PATCH] Ruby: Remove spurious parent-child edges for Ruby::SimpleSymbol. These treesitter nodes translate to multiple AstNodes, but we only want those that are Stmts. --- ruby/ql/lib/codeql/ruby/ast/internal/Synthesis.qll | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/ruby/ql/lib/codeql/ruby/ast/internal/Synthesis.qll b/ruby/ql/lib/codeql/ruby/ast/internal/Synthesis.qll index 072f453826c..9d2dd16ea63 100644 --- a/ruby/ql/lib/codeql/ruby/ast/internal/Synthesis.qll +++ b/ruby/ql/lib/codeql/ruby/ast/internal/Synthesis.qll @@ -1974,9 +1974,12 @@ private module CallableBodySynthesis { i = 0 and child = SynthChild(BodyStmtKind()) or - parent = TBodyStmtSynth(m, 0) and - i = 0 and - child = childRef(fromGenerated(body)) + exists(Stmt bodyStmt | + parent = TBodyStmtSynth(m, 0) and + i = 0 and + bodyStmt = fromGenerated(body) and + child = childRef(bodyStmt) + ) ) }