Merge pull request #6215 from odin-lang/bill/fix-data-races-2026-02

Fix numerous data races
This commit is contained in:
gingerBill
2026-02-02 11:37:19 +00:00
committed by GitHub
12 changed files with 92 additions and 57 deletions

View File

@@ -676,7 +676,7 @@ gb_internal void lb_begin_procedure_body(lbProcedure *p) {
lbAddr res = {};
if (p->entity && p->entity->decl_info &&
p->entity->decl_info->defer_use_checked &&
p->entity->decl_info->defer_use_checked.load(std::memory_order_relaxed) &&
p->entity->decl_info->defer_used == 0) {
// NOTE(bill): this is a bodge to get around the issue of the problem BELOW
@@ -2217,8 +2217,10 @@ gb_internal lbValue lb_build_builtin_proc(lbProcedure *p, Ast *expr, TypeAndValu
Entity *e = entity_of_node(ident);
GB_ASSERT(e != nullptr);
if (e->parent_proc_decl != nullptr && e->parent_proc_decl->entity != nullptr) {
procedure = e->parent_proc_decl->entity.load()->token.string;
DeclInfo *parent_proc_decl = e->parent_proc_decl.load(std::memory_order_relaxed);
if (parent_proc_decl != nullptr &&
parent_proc_decl->entity != nullptr) {
procedure = parent_proc_decl->entity.load()->token.string;
} else {
procedure = str_lit("");
}