mirror of
https://github.com/ziglang/zig.git
synced 2026-02-12 20:37:54 +00:00
codegen: fix union padding
This regressed during the internpool merges. This commit reinstates the padding logic for unions.
This commit is contained in:
parent
098b0b50ab
commit
1cfad29f10
@ -598,6 +598,10 @@ pub fn generateSymbol(
|
||||
.fail => |em| return Result{ .fail = em },
|
||||
}
|
||||
}
|
||||
|
||||
if (layout.padding > 0) {
|
||||
try code.writer().writeByteNTimes(0, layout.padding);
|
||||
}
|
||||
},
|
||||
.memoized_call => unreachable,
|
||||
}
|
||||
|
||||
@ -17,7 +17,6 @@ test "union that needs padding bytes inside an array" {
|
||||
if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
|
||||
if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
|
||||
if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
|
||||
if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest;
|
||||
|
||||
var as = [_]A{
|
||||
A{ .B = B{ .D = 1 } },
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user