Potentially fix race condition #2463 #2814

This commit is contained in:
gingerBill
2023-09-26 12:57:26 +01:00
parent 9711dd1381
commit d358ebd7e6
2 changed files with 26 additions and 7 deletions
+3
View File
@@ -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");