From 84855c0411e399992d96dffce6feeefbcabe1bcb Mon Sep 17 00:00:00 2001 From: Nicolas Cannasse Date: Tue, 14 May 2024 13:06:39 +0200 Subject: [PATCH] fix --- src/std/obj.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/std/obj.c b/src/std/obj.c index 6af616a29..7ca7e26b3 100644 --- a/src/std/obj.c +++ b/src/std/obj.c @@ -244,10 +244,11 @@ HL_PRIM hl_runtime_obj *hl_get_obj_rt( hl_type *ot ) { if( ft->kind == HPACKED ) { // align on packed largest field int large = hl_get_obj_rt(ft->tparam)->largest_field; - if( large < HL_WSIZE ) large = HL_WSIZE; int pad = size % large; if( pad != 0 ) size += large - size; + if( large > largest_field ) + largest_field = large; } else size += hl_pad_struct(size,ft); t->fields_indexes[i+start] = size;