authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2021-04-07 15:02:46-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2021-04-07 15:02:46-07:00
logccdba774c84e2b3c7f650e27f430c9a3eed78fd3
tree5991dfbd6ebcfedfb403bdb414ad0571873a74b7
parent015599d1ef1606e56c49118800a4c7ef36c038e6

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.

1 files changed, 1 insertions(+), 1 deletions(-)

src/AstGen.zig+1-1
...@@ -1857,7 +1857,7 @@ fn containerDecl(...@@ -1857,7 +1857,7 @@ fn containerDecl(
18571857
1858 field_index += 1;1858 field_index += 1;
1859 }1859 }
1860 const empty_slot_count = 16 - ((field_index - 1) % 16);1860 const empty_slot_count = 16 - (field_index % 16);
1861 cur_bit_bag >>= @intCast(u5, empty_slot_count * 2);1861 cur_bit_bag >>= @intCast(u5, empty_slot_count * 2);
18621862
1863 const result = try gz.addPlNode(tag, node, zir.Inst.StructDecl{1863 const result = try gz.addPlNode(tag, node, zir.Inst.StructDecl{