From: Luca Bruno Date: Fri, 26 Oct 2012 23:20:09 +0000 (+0200) Subject: codegen: Fix making local variables and constants active X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e8db18f544b23b3aac9c5940c3f3a3227e483fc3;p=thirdparty%2Fvala.git codegen: Fix making local variables and constants active --- diff --git a/codegen/valaccodetransformer.vala b/codegen/valaccodetransformer.vala index 6f004c46f..bd64fb030 100644 --- a/codegen/valaccodetransformer.vala +++ b/codegen/valaccodetransformer.vala @@ -61,6 +61,7 @@ public class Vala.CCodeTransformer : CodeTransformer { } public override void visit_constant (Constant c) { + c.active = true; c.accept_children (this); } @@ -101,13 +102,6 @@ public class Vala.CCodeTransformer : CodeTransformer { } public override void visit_block (Block b) { - foreach (LocalVariable local in b.get_local_variables ()) { - local.active = true; - } - foreach (Constant constant in b.get_local_constants ()) { - constant.active = true; - } - b.accept_children (this); foreach (LocalVariable local in b.get_local_variables ()) { @@ -123,6 +117,7 @@ public class Vala.CCodeTransformer : CodeTransformer { } public override void visit_local_variable (LocalVariable local) { + local.active = true; local.accept_children (this); }