stage1: Resolve LLVM C ABI type for small packed structs

Small packed structs weren't included in this resolution so their
c_abi_type would be NULL when attempting usage later, leading to a
compiler crash.

Resolves #10431.
This commit is contained in:
paulsnar 2022-01-03 21:23:50 +02:00
parent 850b053ea6
commit 822c3a4819
No known key found for this signature in database
GPG Key ID: 37155EB211976FC1

View File

@ -8962,7 +8962,7 @@ static void resolve_llvm_types_struct(CodeGen *g, ZigType *struct_type, ResolveS
struct_type->data.structure.llvm_full_type_queue_index = SIZE_MAX;
}
if (struct_type->abi_size <= 16 && struct_type->data.structure.layout == ContainerLayoutExtern)
if (struct_type->abi_size <= 16 && (struct_type->data.structure.layout == ContainerLayoutExtern || struct_type->data.structure.layout == ContainerLayoutPacked))
resolve_llvm_c_abi_type(g, struct_type);
}