mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-19 16:47:28 +01:00
Save derived vars (I/O pointers) even on error.
This commit is contained in:
1 parent
7b3628d78f
commit
fc2a295354
3 files changed
+22
-20
No files matched your search
@@ -161,6 +161,7 @@ func (g *gen) writeFuncImpl(n *a.Func) error {
|
||||
|
||||
g.writes("goto suspend;\n") // Avoid the "unused label" warning.
|
||||
g.writes("suspend:\n")
|
||||
|
||||
g.printf("self->private_impl.%s%s[0].coro_susp_point = coro_susp_point;\n",
|
||||
cPrefix, n.Name().String(g.tm))
|
||||
if err := g.writeResumeSuspend(n.Body(), true); err != nil {
|
||||
@@ -168,6 +169,9 @@ func (g *gen) writeFuncImpl(n *a.Func) error {
|
||||
}
|
||||
g.writes("\n")
|
||||
|
||||
g.writes("goto exit;\n") // Avoid the "unused label" warning.
|
||||
g.writes("exit:")
|
||||
|
||||
for _, o := range n.In().Fields() {
|
||||
o := o.Field()
|
||||
if err := g.writeSaveDerivedVar(o.Name(), o.XType()); err != nil {
|
||||
@@ -176,8 +180,6 @@ func (g *gen) writeFuncImpl(n *a.Func) error {
|
||||
}
|
||||
g.writes("\n")
|
||||
|
||||
g.writes("goto exit;\n") // Avoid the "unused label" warning.
|
||||
g.writes("exit:")
|
||||
if g.perFunc.public {
|
||||
g.writes("self->private_impl.status = status;\n")
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user