diff --git a/go/ql/lib/semmle/go/controlflow/ControlFlowGraphShared.qll b/go/ql/lib/semmle/go/controlflow/ControlFlowGraphShared.qll index e4fc1806b24..d4c41ed9b14 100644 --- a/go/ql/lib/semmle/go/controlflow/ControlFlowGraphShared.qll +++ b/go/ql/lib/semmle/go/controlflow/ControlFlowGraphShared.qll @@ -434,6 +434,12 @@ module GoCfg { // "invocation" node (and hence no inline exceptional-exit edge) is // created at the `defer` statement. e = any(Go::DeferStmt s).getCall() + or + // Parenthesized expressions are value-transparent (via `propagatesValue`) + // and should not get an in-order evaluation node. Marking them as + // pre-order prevents the shared library from auto-computing + // `postOrInOrder` for them (which would create an unreachable In node). + e instanceof Go::ParenExpr } predicate propagatesValue(Ast::AstNode child, Ast::AstNode parent) {