1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

cgen: add defered statements before propagating option returns

This commit is contained in:
wilesun 2020-06-08 23:50:23 +08:00 committed by GitHub
parent b4dbf9cacf
commit 564545d20a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3296,6 +3296,7 @@ fn (mut g Gen) or_block(var_name string, or_block ast.OrExpr, return_type table.
g.stmts(stmts) g.stmts(stmts)
} }
} else if or_block.kind == .propagate { } else if or_block.kind == .propagate {
g.write_defer_stmts()
if g.file.mod.name == 'main' && g.cur_fn.name == 'main' { if g.file.mod.name == 'main' && g.cur_fn.name == 'main' {
if g.pref.is_debug { if g.pref.is_debug {
paline, pafile, pamod, pafn := g.panic_debug_info(or_block.pos) paline, pafile, pamod, pafn := g.panic_debug_info(or_block.pos)