Skip to content

Commit 4d90354

Browse files
committed
Produce CFG nodes for more reference expressions, like selector bases
1 parent b1f9ccd commit 4d90354

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

go/ql/lib/semmle/go/controlflow/ControlFlowGraphShared.qll

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,13 @@ module GoCfg {
5252
or
5353
e instanceof Go::SelectorExpr and not e instanceof Go::ReferenceExpr
5454
or
55-
e instanceof Go::ReferenceExpr and not e.(Go::ReferenceExpr).isRvalue()
55+
e instanceof Go::ReferenceExpr and
56+
not e.(Go::ReferenceExpr).isRvalue() and
57+
not e instanceof Go::SelectorExpr and
58+
not e = any(Go::SelectorExpr sel).getBase() and
59+
not e instanceof Go::IndexExpr and
60+
not e = any(Go::IndexExpr idx).getBase() and
61+
not e = any(Go::IndexExpr idx).getIndex()
5662
or
5763
e instanceof Go::ParenExpr
5864
or

0 commit comments

Comments
 (0)