diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2021-04-07 15:02:46 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2021-04-07 15:02:46 -0700 |
| commit | ccdba774c84e2b3c7f650e27f430c9a3eed78fd3 (patch) | |
| tree | 5991dfbd6ebcfedfb403bdb414ad0571873a74b7 /src/AstGen.zig | |
| parent | 015599d1ef1606e56c49118800a4c7ef36c038e6 (diff) | |
| download | zig-ccdba774c84e2b3c7f650e27f430c9a3eed78fd3.tar.gz zig-ccdba774c84e2b3c7f650e27f430c9a3eed78fd3.zip | |
AstGen: fix ZIR struct encoding
off by one error in the bits that describe defaults/field alignments
as soon as we have tests for struct field alignment and default values,
there will be coverage for this.
Diffstat (limited to 'src/AstGen.zig')
| -rw-r--r-- | src/AstGen.zig | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/AstGen.zig b/src/AstGen.zig index 6149169c7f..61174367c3 100644 --- a/src/AstGen.zig +++ b/src/AstGen.zig @@ -1857,7 +1857,7 @@ fn containerDecl( field_index += 1; } - const empty_slot_count = 16 - ((field_index - 1) % 16); + const empty_slot_count = 16 - (field_index % 16); cur_bit_bag >>= @intCast(u5, empty_slot_count * 2); const result = try gz.addPlNode(tag, node, zir.Inst.StructDecl{ |
