Have "return ok" set coro_susp_point = 0.

This commit is contained in:
Nigel Tao committed 2017-10-07 14:43:25 +11:00
1 parent 585ea2024d
commit a12292d094
6 files changed
+60 -15

No files matched your search

+1 -3
View File
@@ -151,9 +151,7 @@ func (g *gen) writeStatement(b *buffer, n *a.Node, depth uint32) error {
if retExpr == nil {
switch ret.keyword.Key() {
case 0:
// TODO: set csp=0, then goto ok.
// Also update the PUFFS_COROUTINE_SUSPENSION_POINT_MAYBE_SUSPEND macro.
b.writes("goto suspend;")
b.writes("goto ok;")
return nil
case t.KeyError:
b.writes("goto exit;")