From c22f17e15f79fdc97b6c5482c796649529eb61d7 Mon Sep 17 00:00:00 2001 From: Cody Tapscott Date: Tue, 1 Nov 2022 08:45:33 -0700 Subject: stage2 llvm: Respect alignment for `.union_init` Resolves #13232. --- src/codegen/llvm.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/codegen') diff --git a/src/codegen/llvm.zig b/src/codegen/llvm.zig index d92a444ea4..bd2807d1bb 100644 --- a/src/codegen/llvm.zig +++ b/src/codegen/llvm.zig @@ -9150,7 +9150,7 @@ pub const FuncGen = struct { // necessarily match the format that we need, depending on which tag is active. We // must construct the correct unnamed struct type here and bitcast, in order to // then set the fields appropriately. - const result_ptr = self.buildAlloca(union_llvm_ty, null); + const result_ptr = self.buildAlloca(union_llvm_ty, layout.abi_align); const llvm_payload = try self.resolveInst(extra.init); assert(union_obj.haveFieldTypes()); const field = union_obj.fields.values()[extra.field_index]; -- cgit v1.2.3