Commit 822c3a4819

paulsnar <paulsnar@paulsnar.lv>
2022-01-03 20:23:50
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.
1 parent 850b053
Changed files (1)
src
src/stage1/analyze.cpp
@@ -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);
 }