Skip to content

Commit

Permalink
possibly fix init_core_type_info race condition
Browse files Browse the repository at this point in the history
  • Loading branch information
laytan committed Aug 10, 2024
1 parent e226d37 commit 6918d8a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/checker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 6918d8a

Please sign in to comment.