Let ? methods return OK even without suspending

This commit is contained in:
Nigel Tao committed 2018-05-27 19:09:58 +10:00
1 parent 865275db75
commit 00203e564f
4 files changed
+17 -11

No files matched your search

+2
View File
@@ -348,8 +348,10 @@ func (g *gen) writeStatementRet(b *buffer, n *a.Ret, depth uint32) error {
case t.IDError:
b.writes("goto exit;")
case t.IDStatus:
g.currFunk.hasGotoOK = true
b.writes("goto ok;")
default:
g.currFunk.hasGotoOK = true
b.printf("if (status == 0) { goto ok; } else if (status > 0) { "+
"status = %sERROR_CANNOT_RETURN_A_SUSPENSION; } goto exit;", g.PKGPREFIX)
}