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 {