Fix ParenExpr consistency test failures

This commit is contained in:
Owen Mansel-Chan
2026-06-29 22:49:44 +01:00
parent 80ee8402c1
commit 107717d473

View File

@@ -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) {