diff options
| author | gingerBill <bill@gingerbill.org> | 2021-08-19 17:38:18 +0100 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2021-08-19 17:38:18 +0100 |
| commit | 38841dd46e6bb5879200c0a8e2f879c8cfa005d6 (patch) | |
| tree | d742d0f758224110243741ae1d99f4d7e51ab3da /src/llvm_backend_proc.cpp | |
| parent | e722af7f6126d821ec2847769b234ed18f61518c (diff) | |
Fix race condition from `add_entity_use` due to Entity.identifier
Diffstat (limited to 'src/llvm_backend_proc.cpp')
| -rw-r--r-- | src/llvm_backend_proc.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/llvm_backend_proc.cpp b/src/llvm_backend_proc.cpp index 9516f2e3d..366fba780 100644 --- a/src/llvm_backend_proc.cpp +++ b/src/llvm_backend_proc.cpp @@ -211,11 +211,12 @@ lbProcedure *lb_create_procedure(lbModule *m, Entity *entity, bool ignore_body) scope = p->module->debug_compile_unit; type = lb_debug_type_internal_proc(m, bt); + Ast *ident = entity->identifier.load(); if (entity->file != nullptr) { file = lb_get_llvm_metadata(m, entity->file); scope = file; - } else if (entity->identifier != nullptr && entity->identifier->file != nullptr) { - file = lb_get_llvm_metadata(m, entity->identifier->file); + } else if (ident != nullptr && ident->file != nullptr) { + file = lb_get_llvm_metadata(m, ident->file); scope = file; } else if (entity->scope != nullptr) { file = lb_get_llvm_metadata(m, entity->scope->file); |