cl: fix CoYield

This commit is contained in:
Li Jie
2024-08-05 12:37:34 +08:00
parent 93bff83e3d
commit a1fdc05e26
4 changed files with 56 additions and 50 deletions

View File

@@ -240,6 +240,7 @@ func (p *context) compileFuncDecl(pkg llssa.Package, f *ssa.Function) (llssa.Fun
}
fn.MakeBlocks(nblk) // to set fn.HasBody() = true
if f.Recover != nil { // set recover block
// TODO(lijie): fix this for async function because of the block offset increase
fn.SetRecover(fn.Block(f.Recover.Index + nBlkOff))
}
p.inits = append(p.inits, func() {