aboutsummaryrefslogtreecommitdiff
path: root/src/check_decl.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2021-08-18 11:17:14 +0100
committergingerBill <bill@gingerbill.org>2021-08-18 11:17:14 +0100
commita01c946c207ccfabd3636c8db8c54fd08f5f54f9 (patch)
tree4b4533686c56148c75bd2c4191fb7a682bbe57be /src/check_decl.cpp
parent84b0da44dbdc5fb02f3d480b6627291bf69e1d74 (diff)
Add mutex to Scope lookups and insertions
Diffstat (limited to 'src/check_decl.cpp')
-rw-r--r--src/check_decl.cpp2
1 files changed, 2 insertions, 0 deletions
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