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

+2 -2
View File
@@ -62,8 +62,8 @@ func (g *gen) writeExprOther(b *buffer, n *a.Expr, depth uint32) error {
} else if ident == t.IDCoroutineResumed {
if g.currFunk.astFunc.Effect().Coroutine() {
// TODO: don't hard-code [0], and allow recursive coroutines.
b.printf("(self->private_impl.%s%s[0].coro_susp_point != 0)",
cPrefix, g.currFunk.astFunc.FuncName().Str(g.tm))
b.printf("(self->private_impl.%s%s[0] != 0)",
pPrefix, g.currFunk.astFunc.FuncName().Str(g.tm))
} else {
b.writes("false")
}