From 9b351174756abea6c2faeb28567849c3afdfa618 Mon Sep 17 00:00:00 2001 From: Owen Mansel-Chan Date: Fri, 29 May 2026 12:49:41 +0100 Subject: [PATCH] Produce CFG nodes for more reference expressions, like selector bases --- .../lib/semmle/go/controlflow/ControlFlowGraphShared.qll | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/go/ql/lib/semmle/go/controlflow/ControlFlowGraphShared.qll b/go/ql/lib/semmle/go/controlflow/ControlFlowGraphShared.qll index 5b77ba08a8f..0c003ea2f3c 100644 --- a/go/ql/lib/semmle/go/controlflow/ControlFlowGraphShared.qll +++ b/go/ql/lib/semmle/go/controlflow/ControlFlowGraphShared.qll @@ -52,7 +52,13 @@ module GoCfg { or e instanceof Go::SelectorExpr and not e instanceof Go::ReferenceExpr or - e instanceof Go::ReferenceExpr and not e.(Go::ReferenceExpr).isRvalue() + e instanceof Go::ReferenceExpr and + not e.(Go::ReferenceExpr).isRvalue() and + not e instanceof Go::SelectorExpr and + not e = any(Go::SelectorExpr sel).getBase() and + not e instanceof Go::IndexExpr and + not e = any(Go::IndexExpr idx).getBase() and + not e = any(Go::IndexExpr idx).getIndex() or e instanceof Go::ParenExpr or