aboutsummaryrefslogtreecommitdiff
path: root/src/check_type.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2023-09-27 11:38:11 +0100
committergingerBill <bill@gingerbill.org>2023-09-27 11:38:11 +0100
commitacc29fbcebf4459b1c98c54d9cc565d363a4196a (patch)
tree91b4692e0a8c9c3958ed44347ded5a2f40ee157d /src/check_type.cpp
parent94d68c1f225c3699d905388baee15e42ec6e49a0 (diff)
parentfc93ea7aa370d25aab61dab43e885f50978dff50 (diff)
Merge branch 'master' into llvm-17
Diffstat (limited to 'src/check_type.cpp')
-rw-r--r--src/check_type.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/check_type.cpp b/src/check_type.cpp
index 5e7e76d66..a43c296a6 100644
--- a/src/check_type.cpp
+++ b/src/check_type.cpp
@@ -613,6 +613,9 @@ gb_internal void check_struct_type(CheckerContext *ctx, Type *struct_type, Ast *
scope_reserve(ctx->scope, min_field_count);
+ rw_mutex_lock(&struct_type->Struct.fields_mutex);
+ defer (rw_mutex_unlock(&struct_type->Struct.fields_mutex));
+
if (st->is_raw_union && min_field_count > 1) {
struct_type->Struct.is_raw_union = true;
context = str_lit("struct #raw_union");