summaryrefslogtreecommitdiff
path: root/codegen
diff options
context:
space:
mode:
authorRico Tzschichholz <ricotz@ubuntu.com>2022-06-14 15:31:17 +0200
committerRico Tzschichholz <ricotz@ubuntu.com>2022-06-14 15:46:39 +0200
commitb98d970f52c7094c70cd65c8c9624e6b7a85bfc3 (patch)
treef7a2358ccffbe9c5a182938d09ac3e75d70fb419 /codegen
parent05b7ed117d79da7b3d22d76c7a49d96a6a958031 (diff)
downloadvala-b98d970f52c7094c70cd65c8c9624e6b7a85bfc3.tar.gz
codegen: Make sure to initialize static collections
Diffstat (limited to 'codegen')
-rw-r--r--codegen/valaccode.vala3
-rw-r--r--codegen/valaccodebasemodule.vala8
2 files changed, 11 insertions, 0 deletions
diff --git a/codegen/valaccode.vala b/codegen/valaccode.vala
index 25a0d11af..30d196b9e 100644
--- a/codegen/valaccode.vala
+++ b/codegen/valaccode.vala
@@ -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);
diff --git a/codegen/valaccodebasemodule.vala b/codegen/valaccodebasemodule.vala
index 121344373..c30f0dae9 100644
--- a/codegen/valaccodebasemodule.vala
+++ b/codegen/valaccodebasemodule.vala
@@ -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