Fix bug when initializing nested struct / unions. Fix of mult of 2x2 matrix. Cleanup of cast.

This commit is contained in:
Christoffer Lerno
2023-02-28 20:43:43 +01:00
parent 6188a8b5df
commit b9dbefbe1b
4 changed files with 10 additions and 14 deletions

View File

@@ -1720,15 +1720,6 @@ static inline void llvm_emit_initialize_reference_list(GenContext *c, BEValue *r
llvm_value_addr(c, ref);
LLVMValueRef value = ref->value;
// If this is a union, we assume it's initializing the first element.
if (real_type->type_kind == TYPE_UNION)
{
assert(vec_size(elements) == 1);
real_type = type_lowering(real_type->decl->strukt.members[0]->type);
ref->type = real_type;
}
LLVMTypeRef llvm_type = llvm_get_type(c, real_type);
bool is_struct = type_is_union_or_strukt(real_type);
bool is_array = real_type->type_kind == TYPE_ARRAY;