diff options
| author | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2020-09-24 21:49:00 +0200 |
|---|---|---|
| committer | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2020-10-01 00:44:53 +0200 |
| commit | 338dd771d713a9725cc70ee62ac5553ad10dcf26 (patch) | |
| tree | cb572ae1b9c467d80d5fb01875a6a50011b9f0e9 | |
| parent | e5b7d1ecb8425fda8674b1c0b73a118e4aa16560 (diff) | |
| download | sparse-dev-338dd771d713a9725cc70ee62ac5553ad10dcf26.tar.gz | |
flex-array: do not lay out invalid struct members
Do not bother trying to lay out invalid struct members,
ignore them as it will avoid to special case them later.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
| -rw-r--r-- | symbol.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -121,10 +121,12 @@ static void lay_out_struct(struct symbol *sym, struct struct_union_info *info) base_size = sym->bit_size; /* - * Unsized arrays cause us to not align the resulting - * structure size + * If the member is unsized, either it's a flexible array or + * it's invalid and a warning has already been issued. */ if (base_size < 0) { + if (!is_array_type(sym)) + return; info->align_size = 0; base_size = 0; } |
