Skip to content

Commit

Permalink
go/ir: don't build exit block before we know the return parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
dominikh committed May 25, 2024
1 parent 36c8ae1 commit 95e1ba4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion go/ir/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -3155,12 +3155,12 @@ func (b *builder) buildYieldFunc(fn *Function) {
s := fn.source.(*ast.RangeStmt)
fn.sourceFn = fn.parent.sourceFn
fn.startBody()
fn.exitBlock()
params := fn.Signature.Params()
for i := 0; i < params.Len(); i++ {
fn.addParamVar(params.At(i), nil)
}
fn.addResultVar(fn.Signature.Results().At(0), nil)
fn.exitBlock()

// Initial targets
ycont := fn.newBasicBlock("yield-continue")
Expand Down

0 comments on commit 95e1ba4

Please sign in to comment.