From 564545d20afda7b58651de74a2810a90e3b9df68 Mon Sep 17 00:00:00 2001 From: wilesun Date: Mon, 8 Jun 2020 23:50:23 +0800 Subject: [PATCH] cgen: add defered statements before propagating option returns --- vlib/v/gen/cgen.v | 1 + 1 file changed, 1 insertion(+) diff --git a/vlib/v/gen/cgen.v b/vlib/v/gen/cgen.v index 96aa513531..097f0a692d 100644 --- a/vlib/v/gen/cgen.v +++ b/vlib/v/gen/cgen.v @@ -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)