diff options
| author | gingerBill <bill@gingerbill.org> | 2022-01-11 10:56:07 +0000 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2022-01-11 10:56:07 +0000 |
| commit | 847b05013f71c69a4123fe5a4606c88039b716a3 (patch) | |
| tree | 4d0df625a3d1f60bf4ebe89782261aa70434751d /src/check_decl.cpp | |
| parent | 32ec1162bf467359ed47ba0bd4e74ec0c7fbd167 (diff) | |
Disable `DEFAULT_TO_THREADED_CHECKER` until race condition is found
Diffstat (limited to 'src/check_decl.cpp')
| -rw-r--r-- | src/check_decl.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/check_decl.cpp b/src/check_decl.cpp index 55ad67abf..3f7d2f33d 100644 --- a/src/check_decl.cpp +++ b/src/check_decl.cpp @@ -1286,7 +1286,7 @@ void check_proc_body(CheckerContext *ctx_, Token token, DeclInfo *decl, Type *ty using_entities.allocator = heap_allocator(); defer (array_free(&using_entities)); - MUTEX_GUARD_BLOCK(ctx->scope->mutex) { + { if (type->Proc.param_count > 0) { TypeTuple *params = &type->Proc.params->Tuple; for_array(i, params->variables) { @@ -1303,7 +1303,7 @@ void check_proc_body(CheckerContext *ctx_, Token token, DeclInfo *decl, Type *ty if (t->kind == Type_Struct) { Scope *scope = t->Struct.scope; GB_ASSERT(scope != nullptr); - for_array(i, scope->elements.entries) { + MUTEX_GUARD_BLOCK(scope->mutex) for_array(i, scope->elements.entries) { Entity *f = scope->elements.entries[i].value; if (f->kind == Entity_Variable) { Entity *uvar = alloc_entity_using_variable(e, f->token, f->type, nullptr); @@ -1321,11 +1321,10 @@ void check_proc_body(CheckerContext *ctx_, Token token, DeclInfo *decl, Type *ty } } - - for_array(i, using_entities) { + MUTEX_GUARD_BLOCK(ctx->scope->mutex) for_array(i, using_entities) { Entity *e = using_entities[i].e; Entity *uvar = using_entities[i].uvar; - Entity *prev = scope_insert(ctx->scope, uvar); + Entity *prev = scope_insert(ctx->scope, uvar, false); if (prev != nullptr) { error(e->token, "Namespace collision while 'using' procedure argument '%.*s' of: %.*s", LIT(e->token.string), LIT(prev->token.string)); error_line("%.*s != %.*s\n", LIT(uvar->token.string), LIT(prev->token.string)); |