]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
codegen: Free locals before executing finally block
authorJürg Billeter <j@bitron.ch>
Wed, 27 Apr 2011 10:48:18 +0000 (12:48 +0200)
committerJürg Billeter <j@bitron.ch>
Wed, 27 Apr 2011 10:48:18 +0000 (12:48 +0200)
Inner variables should be freed before outer variables.

codegen/valagerrormodule.vala

index 0918a20be6cea639e90c9ed50fd833b2b7b1f563..70d335d56340211d70a18536061d627928c54274 100644 (file)
@@ -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);
        }
 }