Skip to content

Commit 19b8a08

Browse files
committed
Fix ParenExpr consistency test failures
1 parent e3f938e commit 19b8a08

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -440,6 +440,12 @@ module GoCfg {
440440
// "invocation" node (and hence no inline exceptional-exit edge) is
441441
// created at the `defer` statement.
442442
e = any(Go::DeferStmt s).getCall()
443+
or
444+
// Parenthesized expressions are value-transparent (via `propagatesValue`)
445+
// and should not get an in-order evaluation node. Marking them as
446+
// pre-order prevents the shared library from auto-computing
447+
// `postOrInOrder` for them (which would create an unreachable In node).
448+
e instanceof Go::ParenExpr
443449
}
444450

445451
predicate propagatesValue(Ast::AstNode child, Ast::AstNode parent) {

0 commit comments

Comments
 (0)