diff options
| author | Linus Torvalds <torvalds@penguin.transmeta.com> | 2003-04-02 16:38:52 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-07 21:00:05 -0700 |
| commit | d787344efc7a4b926848041317f8dfcd71e39411 (patch) | |
| tree | e28193ecd94cba5e71ff3e238199f80c7a306349 | |
| parent | 52c719d062a95db6016a63fae67193f4dcd26974 (diff) | |
| download | sparse-dev-d787344efc7a4b926848041317f8dfcd71e39411.tar.gz | |
Make structure size calculations handle the case where
the structure might have been pre-aligned.
| -rw-r--r-- | symbol.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -108,12 +108,12 @@ static void examine_struct_union_type(struct symbol *sym, int advance) fn = advance ? lay_out_struct : lay_out_union; symbol_iterate(sym->symbol_list, fn, &info); + if (!sym->ctype.alignment) + sym->ctype.alignment = info.max_align; bit_size = info.bit_size; - bit_align = (info.max_align << 3)-1; + bit_align = (sym->ctype.alignment << 3)-1; bit_size = (bit_size + bit_align) & ~bit_align; sym->bit_size = bit_size; - if (info.max_align > sym->ctype.alignment) - sym->ctype.alignment = info.max_align; } static void examine_array_type(struct symbol *sym) |
