Keep structure members aligned

This commit is contained in:
Bill Currie 2020-02-24 08:43:32 +09:00
parent 2adcad7c84
commit c43b9681eb

View file

@ -124,6 +124,7 @@ build_struct (int su, symbol_t *tag, symtab_t *symtab, type_t *type)
if (s->sy_type != sy_var)
continue;
if (su == 's') {
symtab->size = RUP (symtab->size, s->type->alignment);
s->s.offset = symtab->size;
symtab->size += type_size (s->type);
} else {