From a01c946c207ccfabd3636c8db8c54fd08f5f54f9 Mon Sep 17 00:00:00 2001 From: gingerBill Date: Wed, 18 Aug 2021 11:17:14 +0100 Subject: Add mutex to Scope lookups and insertions --- src/check_decl.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/check_decl.cpp') diff --git a/src/check_decl.cpp b/src/check_decl.cpp index a8f1f9aec..06214810b 100644 --- a/src/check_decl.cpp +++ b/src/check_decl.cpp @@ -334,6 +334,8 @@ void override_entity_in_scope(Entity *original_entity, Entity *new_entity) { if (found_scope == nullptr) { return; } + mutex_lock(&found_scope->mutex); + defer (mutex_unlock(&found_scope->mutex)); // IMPORTANT NOTE(bill, 2021-04-10): Overriding behaviour was flawed in that the // original entity was still used check checked, but the checking was only -- cgit v1.2.3