codegen: actually write out padding for packed structs upfront

This commit is contained in:
Jakub Konka 2024-03-25 00:00:33 +01:00
parent c5a5b420dc
commit e599ed4a5f

View File

@ -517,7 +517,7 @@ pub fn generateSymbol(
const abi_size = math.cast(usize, typed_value.ty.abiSize(mod)) orelse
return error.Overflow;
const current_pos = code.items.len;
try code.resize(current_pos + abi_size);
try code.writer().writeByteNTimes(0, abi_size);
var bits: u16 = 0;
for (struct_type.field_types.get(ip), 0..) |field_ty, index| {