pahole: Filter out unions when looking for packable structs

After we made -C apply for unions we had to stop calling
class__find_holes() on them, but forgot to also filter them out when
using --packable, which lead us to, in print_packable_info to access
class->priv for unions, as they were not filtered out, which made
it think that class->priv had the reordered cloned class, b00m.

Fix it by filtering out unions when doing --packable.

Fixes: 3ffe5ba93b ("pahole: Do not apply 'struct class' filters to 'struct type'")
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
Arnaldo Carvalho de Melo 2019-03-28 16:48:11 -03:00
parent fa963e1a86
commit 69970fc77e
1 changed files with 1 additions and 1 deletions

View File

@ -413,7 +413,7 @@ static struct class *class__filter(struct class *class, struct cu *cu,
* bail out if we get here with an union
*/
if (!tag__is_struct(class__tag(class)))
return class;
return show_packable ? NULL : class;
if (tag->top_level)
class__find_holes(class);