]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
codegen: Fix making local variables and constants active
authorLuca Bruno <lucabru@src.gnome.org>
Fri, 26 Oct 2012 23:20:09 +0000 (01:20 +0200)
committerRico Tzschichholz <ricotz@ubuntu.com>
Mon, 11 Mar 2019 12:52:38 +0000 (13:52 +0100)
codegen/valaccodetransformer.vala

index 6f004c46f50d85d04b22acfd4ee71a19fcefbc84..bd64fb0308255cde202ef963fee3dc4636264e84 100644 (file)
@@ -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);
        }