Skip to content

Commit 39697ee

Browse files
committed
Create cfg node for child of ParenExpr
1 parent 2d46e22 commit 39697ee

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,11 @@ module GoCfg {
6262
}
6363

6464
AstNode getChild(AstNode n, int index) {
65-
not skipCfg(result) and not skipCfg(n) and result = n.getChild(index)
65+
not skipCfg(n) and
66+
not skipCfg(result) and
67+
exists(Go::AstNode c | c = n.getChild(index) |
68+
if c instanceof Go::ParenExpr then result = c.(Go::ParenExpr).stripParens() else result = c
69+
)
6670
}
6771

6872
class Callable extends AstNode {

0 commit comments

Comments
 (0)