From 53a6afa218f374de4004c1819b2b58b66f0163bd Mon Sep 17 00:00:00 2001 From: Owen Mansel-Chan Date: Wed, 3 Jun 2026 14:01:20 +0100 Subject: [PATCH] Fix treatment of `ParenExpr` --- .../semmle/go/controlflow/ControlFlowGraphShared.qll | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/go/ql/lib/semmle/go/controlflow/ControlFlowGraphShared.qll b/go/ql/lib/semmle/go/controlflow/ControlFlowGraphShared.qll index cf7fe2e336d..7ef3f5034f7 100644 --- a/go/ql/lib/semmle/go/controlflow/ControlFlowGraphShared.qll +++ b/go/ql/lib/semmle/go/controlflow/ControlFlowGraphShared.qll @@ -60,8 +60,6 @@ module GoCfg { not e = any(Go::IndexExpr idx).getBase() and not e = any(Go::IndexExpr idx).getIndex() or - e instanceof Go::ParenExpr - or e instanceof Go::CommentGroup or e instanceof Go::Comment @@ -75,9 +73,7 @@ module GoCfg { not n instanceof Go::FuncDef and 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 - ) + result = n.getChild(index) } class Callable extends AstNode { @@ -360,6 +356,10 @@ module GoCfg { predicate preOrderExpr(Ast::Expr e) { none() } + predicate propagatesValue(Ast::AstNode child, Ast::AstNode parent) { + child = parent.(Go::ParenExpr).getExpr() + } + predicate postOrInOrder(Ast::AstNode n) { n instanceof Go::ReferenceExpr or