From acabae8644dc5fb9cfb1c7dbb2f45625529ab760 Mon Sep 17 00:00:00 2001 From: gingerBill Date: Mon, 2 Feb 2026 10:58:25 +0000 Subject: Make `Entity.parent_proc_decl` atomic --- src/entity.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/entity.cpp') diff --git a/src/entity.cpp b/src/entity.cpp index 97c908fea..070b05462 100644 --- a/src/entity.cpp +++ b/src/entity.cpp @@ -170,7 +170,7 @@ struct Entity { Type * type; std::atomic identifier; // Can be nullptr DeclInfo * decl_info; - DeclInfo * parent_proc_decl; // nullptr if in file/global scope + std::atomic parent_proc_decl; // nullptr if in file/global scope AstFile * file; AstPackage *pkg; @@ -370,7 +370,7 @@ gb_internal Entity *alloc_entity_using_variable(Entity *parent, Token token, Typ token.pos = parent->token.pos; Entity *entity = alloc_entity(Entity_Variable, parent->scope, token, type); entity->using_parent = parent; - entity->parent_proc_decl = parent->parent_proc_decl; + entity->parent_proc_decl.store(parent->parent_proc_decl, std::memory_order_relaxed); entity->using_expr = using_expr; entity->flags |= EntityFlag_Using; entity->flags |= EntityFlag_Used; -- cgit v1.2.3