diff options
| author | gingerBill <bill@gingerbill.org> | 2023-01-02 15:30:04 +0000 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2023-01-02 15:30:04 +0000 |
| commit | 529383f5b17d74f66bebb8679820a69476635b6a (patch) | |
| tree | 67754a8f0458378fb67888912e6cf956956aa01a /src/llvm_backend_expr.cpp | |
| parent | f01cff7ff0d61a4bd222be159243775b5d9bf3e7 (diff) | |
Correct a race condition when checking the procedure body
Diffstat (limited to 'src/llvm_backend_expr.cpp')
| -rw-r--r-- | src/llvm_backend_expr.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/llvm_backend_expr.cpp b/src/llvm_backend_expr.cpp index d574caf4c..28a68b065 100644 --- a/src/llvm_backend_expr.cpp +++ b/src/llvm_backend_expr.cpp @@ -3404,7 +3404,11 @@ gb_internal lbAddr lb_build_addr_from_entity(lbProcedure *p, Entity *e, Ast *exp lbValue v = {}; - lbValue *found = map_get(&p->module->values, e); + lbValue *found = nullptr; + found = map_get(&p->local_entity_map, e); + if (found == nullptr) { + found = map_get(&p->module->values, e); + } if (found) { v = *found; } else if (e->kind == Entity_Variable && e->flags & EntityFlag_Using) { |