aboutsummaryrefslogtreecommitdiff
path: root/src/entity.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2021-08-19 17:38:18 +0100
committergingerBill <bill@gingerbill.org>2021-08-19 17:38:18 +0100
commit38841dd46e6bb5879200c0a8e2f879c8cfa005d6 (patch)
treed742d0f758224110243741ae1d99f4d7e51ab3da /src/entity.cpp
parente722af7f6126d821ec2847769b234ed18f61518c (diff)
Fix race condition from `add_entity_use` due to Entity.identifier
Diffstat (limited to 'src/entity.cpp')
-rw-r--r--src/entity.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/entity.cpp b/src/entity.cpp
index fb65bc3a8..9f3b8f84d 100644
--- a/src/entity.cpp
+++ b/src/entity.cpp
@@ -120,7 +120,7 @@ struct Entity {
Token token;
Scope * scope;
Type * type;
- Ast * identifier; // Can be nullptr
+ std::atomic<Ast *> identifier; // Can be nullptr
DeclInfo * decl_info;
DeclInfo * parent_proc_decl; // nullptr if in file/global scope
AstFile * file;