diff options
| author | Cody Tapscott <topolarity@tapscott.me> | 2022-11-01 08:45:33 -0700 |
|---|---|---|
| committer | Veikka Tuominen <git@vexu.eu> | 2022-11-02 12:45:06 +0200 |
| commit | c22f17e15f79fdc97b6c5482c796649529eb61d7 (patch) | |
| tree | 7b1ebb4b912e04d54a181c42879b4df6ef704407 /src/codegen/llvm.zig | |
| parent | 81c27677d424d6cd4b1211a7d2e840232e93c650 (diff) | |
| download | zig-c22f17e15f79fdc97b6c5482c796649529eb61d7.tar.gz zig-c22f17e15f79fdc97b6c5482c796649529eb61d7.zip | |
stage2 llvm: Respect alignment for `.union_init`
Resolves #13232.
Diffstat (limited to 'src/codegen/llvm.zig')
| -rw-r--r-- | src/codegen/llvm.zig | 2 |
1 files changed, 1 insertions, 1 deletions
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]; |
