diff options
| author | Luuk de Gram <luuk@degram.dev> | 2022-03-06 15:57:28 +0100 |
|---|---|---|
| committer | Luuk de Gram <luuk@degram.dev> | 2022-03-06 16:04:15 +0100 |
| commit | 23e2368ac339842b907ccc36580c3a471bb26d43 (patch) | |
| tree | 1522a9e220c037f9a019335b212e1901e6801102 /src/codegen | |
| parent | bf972e44d5d0ce704cae99957d565c55ea16335d (diff) | |
| download | zig-23e2368ac339842b907ccc36580c3a471bb26d43.tar.gz zig-23e2368ac339842b907ccc36580c3a471bb26d43.zip | |
stage2: Fix codegen for unions and error unions
When an union had a zero-sized payload type, we would lower the tag twice. This is fixed
by exiting early when `payload_size` is 0.
With regards to error unions, we were only accounting for padding for the payload field.
However, the errorset value can have a smaller alignment than the payload as well, i.e. error!usize.
We fix this by also accounting for padding/alignment of the error set tag of an error union.
Diffstat (limited to 'src/codegen')
0 files changed, 0 insertions, 0 deletions
