mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-24 16:52:18 +01:00
Let ? methods return OK even without suspending
This commit is contained in:
1 parent
865275db75
commit
00203e564f
4 files changed
+17
-11
No files matched your search
@@ -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)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user