Separate the coro_susp_point from the coro stack

This commit is contained in:
Nigel Tao committed 2019-02-09 11:03:50 +11:00
1 parent 2928806ab6
commit 9518af5a95
6 files changed
+292 -317

No files matched your search

+1 -1
View File
@@ -229,7 +229,7 @@ func (g *gen) writeResumeSuspend1(b *buffer, f *funk, n *a.Var, suspend bool) er
local := fmt.Sprintf("%s%s", vPrefix, n.Name().Str(g.tm))
lhs := local
// TODO: don't hard-code [0], and allow recursive coroutines.
rhs := fmt.Sprintf("self->private_impl.%s%s[0].%s", cPrefix, g.currFunk.astFunc.FuncName().Str(g.tm), lhs)
rhs := fmt.Sprintf("self->private_impl.%s%s[0].%s", sPrefix, g.currFunk.astFunc.FuncName().Str(g.tm), lhs)
if suspend {
lhs, rhs = rhs, lhs
}