cgen: add defered statements before propagating option returns

pull/5290/head
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
1 changed files with 1 additions and 0 deletions

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)
}
} else if or_block.kind == .propagate {
g.write_defer_stmts()
if g.file.mod.name == 'main' && g.cur_fn.name == 'main' {
if g.pref.is_debug {
paline, pafile, pamod, pafn := g.panic_debug_info(or_block.pos)