Преглед изворни кода

possibly fix init_core_type_info race condition

Laytan Laats пре 1 година
родитељ
комит
6918d8aaa6
1 измењених фајлова са 3 додато и 0 уклоњено
  1. 3 0
      src/checker.cpp

+ 3 - 0
src/checker.cpp

@@ -2991,6 +2991,9 @@ gb_internal void init_core_type_info(Checker *c) {
 	}
 	Entity *type_info_entity = find_core_entity(c, str_lit("Type_Info"));
 	GB_ASSERT(type_info_entity != nullptr);
+	if (type_info_entity->type == nullptr) {
+		check_single_global_entity(c, type_info_entity, type_info_entity->decl_info);
+	}
 	GB_ASSERT(type_info_entity->type != nullptr);
 
 	t_type_info = type_info_entity->type;