From 39697ee971cf9dd1cd986f12ef8727ad377baa65 Mon Sep 17 00:00:00 2001 From: Owen Mansel-Chan Date: Thu, 14 May 2026 00:21:08 +0100 Subject: [PATCH] Create cfg node for child of ParenExpr --- go/ql/lib/semmle/go/controlflow/ControlFlowGraphShared.qll | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/go/ql/lib/semmle/go/controlflow/ControlFlowGraphShared.qll b/go/ql/lib/semmle/go/controlflow/ControlFlowGraphShared.qll index 7686e40eaf6..24a687cbdf7 100644 --- a/go/ql/lib/semmle/go/controlflow/ControlFlowGraphShared.qll +++ b/go/ql/lib/semmle/go/controlflow/ControlFlowGraphShared.qll @@ -62,7 +62,11 @@ module GoCfg { } AstNode getChild(AstNode n, int index) { - not skipCfg(result) and not skipCfg(n) and result = n.getChild(index) + not skipCfg(n) and + not skipCfg(result) and + exists(Go::AstNode c | c = n.getChild(index) | + if c instanceof Go::ParenExpr then result = c.(Go::ParenExpr).stripParens() else result = c + ) } class Callable extends AstNode {