diff --git a/cmd/wuffs-c/internal/cgen/builtin.go b/cmd/wuffs-c/internal/cgen/builtin.go index 7c9bd07e..98063aba 100644 --- a/cmd/wuffs-c/internal/cgen/builtin.go +++ b/cmd/wuffs-c/internal/cgen/builtin.go @@ -539,7 +539,7 @@ func (g *gen) writeArgs(b *buffer, args []*a.Node, depth uint32) error { func (g *gen) writeBuiltinQuestionCall(b *buffer, n *a.Expr, depth uint32) error { // TODO: also handle (or reject??) being on the RHS of an =? operator. - if n.Operator() != t.IDOpenParen { + if (n.Operator() != t.IDOpenParen) || (!n.Effect().Coroutine()) { return errNoSuchBuiltin } method := n.LHS().AsExpr() diff --git a/cmd/wuffs-c/internal/cgen/statement.go b/cmd/wuffs-c/internal/cgen/statement.go index fba15439..f3ebfb9e 100644 --- a/cmd/wuffs-c/internal/cgen/statement.go +++ b/cmd/wuffs-c/internal/cgen/statement.go @@ -111,12 +111,8 @@ func (g *gen) writeStatementAssign(b *buffer, op t.ID, lhs *a.Expr, rhs *a.Expr, } func (g *gen) writeStatementAssign0(b *buffer, op t.ID, lhs *a.Expr, rhs *a.Expr) error { - if rhs.Effect().Coroutine() { - if err := g.writeBuiltinQuestionCall(b, rhs, 0); err == nil { - return nil - } else if err != errNoSuchBuiltin { - return err - } + if err := g.writeBuiltinQuestionCall(b, rhs, 0); err != errNoSuchBuiltin { + return err } if (lhs == nil) || rhs.Effect().Coroutine() {