]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
codegen: Make sure to initialize static collections
authorRico Tzschichholz <ricotz@ubuntu.com>
Tue, 14 Jun 2022 13:31:17 +0000 (15:31 +0200)
committerRico Tzschichholz <ricotz@ubuntu.com>
Tue, 14 Jun 2022 13:46:39 +0000 (15:46 +0200)
codegen/valaccode.vala
codegen/valaccodebasemodule.vala

index 25a0d11af9e642d3f37d6eadd8bbd448d9630b3b..30d196b9e6603df68d040e4f179383969ad7047e 100644 (file)
@@ -26,6 +26,9 @@ namespace Vala {
        static unowned CCodeAttribute get_ccode_attribute (CodeNode node) {
                if (ccode_attribute_cache_index == null) {
                        ccode_attribute_cache_index = CodeNode.get_attribute_cache_index ();
+
+                       // make sure static collections are initialized
+                       CCodeBaseModule.init ();
                }
 
                unowned AttributeCache? attr = node.get_attribute_cache (ccode_attribute_cache_index);
index 12134437334c59fdbdd8194ecae3336f5a7c73a5..c30f0dae9e2e2ab5f8d1f14700ce1dd3a07aba0c 100644 (file)
@@ -405,6 +405,14 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
                predefined_marshal_set.add ("VOID:VARIANT");
                predefined_marshal_set.add ("BOOLEAN:BOXED,BOXED");
 
+               init ();
+       }
+
+       public static void init () {
+               if (reserved_identifiers != null) {
+                       return;
+               }
+
                reserved_identifiers = new HashSet<string> (str_hash, str_equal);
 
                // C99 keywords