authorgravatar for topolarity@tapscott.meCody Tapscott <topolarity@tapscott.me> 2022-03-11 14:19:45-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2022-03-14 21:42:42-07:00
log54426bdc82ad361bb580f9678dd23417c350282a
tree7bdccf81b411acdc0ffad5e5f585e865e6b7280c
parent34a6fcd88e20a2491bf6a5396d583a7449cac20b

stage2: Fix assertion in struct field offset when all fields are 0-size


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

src/type.zig+2-2
...@@ -4786,7 +4786,7 @@ pub const Type = extern union {...@@ -4786,7 +4786,7 @@ pub const Type = extern union {
4786 return field_offset.offset;4786 return field_offset.offset;
4787 }4787 }
47884788
4789 return std.mem.alignForwardGeneric(u64, it.offset, it.big_align);4789 return std.mem.alignForwardGeneric(u64, it.offset, @maximum(it.big_align, 1));
4790 },4790 },
47914791
4792 .tuple, .anon_struct => {4792 .tuple, .anon_struct => {
...@@ -4809,7 +4809,7 @@ pub const Type = extern union {...@@ -4809,7 +4809,7 @@ pub const Type = extern union {
4809 if (i == index) return offset;4809 if (i == index) return offset;
4810 offset += field_ty.abiSize(target);4810 offset += field_ty.abiSize(target);
4811 }4811 }
4812 offset = std.mem.alignForwardGeneric(u64, offset, big_align);4812 offset = std.mem.alignForwardGeneric(u64, offset, @maximum(big_align, 1));
4813 return offset;4813 return offset;
4814 },4814 },
48154815