commit c22f17e15f79fdc97b6c5482c796649529eb61d7 (tree)
parent 81c27677d424d6cd4b1211a7d2e840232e93c650
Author: Cody Tapscott <topolarity@tapscott.me>
Date: Tue, 1 Nov 2022 08:45:33 -0700
stage2 llvm: Respect alignment for `.union_init`
Resolves #13232.
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git 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];