mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-19 16:47:28 +01:00
Save derived vars for returns in non-coroutines
This commit is contained in:
1 parent
0aacdfd6e3
commit
6a7a4d08e3
3 files changed
+29
-23
No files matched your search
@@ -471,6 +471,15 @@ func (g *gen) writeStatementRet(b *buffer, n *a.Ret, depth uint32) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
if g.currFunk.derivedVars != nil {
|
||||
for _, o := range g.currFunk.astFunc.In().Fields() {
|
||||
o := o.AsField()
|
||||
if err := g.writeSaveDerivedVar(b, "", aPrefix, o.Name(), o.XType()); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
b.writes("return ")
|
||||
if g.currFunk.astFunc.Out() == nil {
|
||||
b.writes("wuffs_base__make_empty_struct()")
|
||||
|
||||
Reference in new issue
Block a user