]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
codegen: Make *_try_id specific to emit-context instead being global states
authorRico Tzschichholz <ricotz@ubuntu.com>
Mon, 3 Feb 2020 12:22:28 +0000 (13:22 +0100)
committerRico Tzschichholz <ricotz@ubuntu.com>
Mon, 3 Feb 2020 12:33:40 +0000 (13:33 +0100)
codegen/valaccodebasemodule.vala
codegen/valagerrormodule.vala

index f8ff16872340b86d67969137422002f7a0d26a61..52bc6d930a9d60670e28f72570b8a83f3a17144f 100644 (file)
@@ -31,6 +31,8 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
                public Symbol? current_symbol;
                public ArrayList<Symbol> symbol_stack = new ArrayList<Symbol> ();
                public TryStatement current_try;
+               public int current_try_id;
+               public int next_try_id;
                public CatchClause current_catch;
                public CCodeFunction ccode;
                public ArrayList<CCodeFunction> ccode_stack = new ArrayList<CCodeFunction> ();
@@ -77,6 +79,16 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
                set { emit_context.current_try = value; }
        }
 
+       public int current_try_id {
+               get { return emit_context.current_try_id; }
+               set { emit_context.current_try_id = value; }
+       }
+
+       public int next_try_id {
+               get { return emit_context.next_try_id; }
+               set { emit_context.next_try_id = value; }
+       }
+
        public CatchClause current_catch {
                get { return emit_context.current_catch; }
                set { emit_context.current_catch = value; }
index d54f0d9d12e0e574e9f309dda4230117f6e52f8d..75baa8b5a50837658fe15e5ccb2073747a73b004 100644 (file)
@@ -24,8 +24,6 @@
 using GLib;
 
 public class Vala.GErrorModule : CCodeDelegateModule {
-       private int current_try_id = 0;
-       private int next_try_id = 0;
        private bool is_in_catch = false;
 
        public override void generate_error_domain_declaration (ErrorDomain edomain, CCodeFile decl_space) {