mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-10 15:22:04 +00:00
[qfcc] Apply member alignment to union size
Seeing a union of size 7 when its members need an alignment of 4 was rather a concern.
This commit is contained in:
parent
e4391992cb
commit
ad6b4057f9
1 changed files with 3 additions and 2 deletions
|
@ -175,8 +175,9 @@ build_struct (int su, symbol_t *tag, symtab_t *symtab, type_t *type, int base)
|
|||
symtab->size += type_size (s->type);
|
||||
} else {
|
||||
int size = type_size (s->type);
|
||||
if (size > symtab->size)
|
||||
symtab->size = size;
|
||||
if (size > symtab->size) {
|
||||
symtab->size = RUP (size, s->type->alignment);
|
||||
}
|
||||
}
|
||||
if (s->type->alignment > alignment) {
|
||||
alignment = s->type->alignment;
|
||||
|
|
Loading…
Reference in a new issue