From: Jürg Billeter Date: Wed, 27 Apr 2011 10:48:18 +0000 (+0200) Subject: codegen: Free locals before executing finally block X-Git-Tag: 0.13.0~204 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a0648afbd890210c677e0664df4bcc559399037f;p=thirdparty%2Fvala.git codegen: Free locals before executing finally block Inner variables should be freed before outer variables. --- diff --git a/codegen/valagerrormodule.vala b/codegen/valagerrormodule.vala index 0918a20be..70d335d56 100644 --- a/codegen/valagerrormodule.vala +++ b/codegen/valagerrormodule.vala @@ -373,6 +373,8 @@ public class Vala.GErrorModule : CCodeDelegateModule { } public override void append_local_free (Symbol sym, bool stop_at_loop = false, CodeNode? stop_at = null) { + base.append_local_free (sym, stop_at_loop, stop_at); + if (!(stop_at is TryStatement || stop_at is CatchClause)) { var finally_block = (Block) null; if (sym.parent_node is TryStatement) { @@ -385,8 +387,6 @@ public class Vala.GErrorModule : CCodeDelegateModule { finally_block.emit (this); } } - - base.append_local_free (sym, stop_at_loop, stop_at); } }