From f04d93f9aad177410ad6bc112ba73628476126cd Mon Sep 17 00:00:00 2001 From: Christoffer Lerno Date: Mon, 20 May 2024 22:20:33 +0200 Subject: [PATCH] Fix flaw in bitstruct check. --- src/compiler/llvm_codegen_expr.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/compiler/llvm_codegen_expr.c b/src/compiler/llvm_codegen_expr.c index 9946251e2..e4522abe8 100644 --- a/src/compiler/llvm_codegen_expr.c +++ b/src/compiler/llvm_codegen_expr.c @@ -2017,10 +2017,9 @@ static void llvm_emit_initialize_designated_element(GenContext *c, BEValue *ref, { llvm_value_struct_gep(c, &value, ref, (unsigned) curr->index); } - if (type->type_kind == TYPE_BITSTRUCT) + if (type->type_kind == TYPE_BITSTRUCT && last == current + 1) { assert(llvm_value_is_addr(&value)); - assert(last == current + 1); Decl *member = type->decl->bitstruct.members[last[0]->index]; // Special handling of bitstructs. Type *underlying_type = value.type;