@@ -957,6 +957,8 @@ static int linearize_address_gen(struct entrypoint *ep,
*/
static inline int is_promotable(struct symbol *type)
{
+ struct symbol *member;
+
if (type->type == SYM_NODE)
type = type->ctype.base_type;
switch (type->type) {
@@ -967,7 +969,13 @@ static inline int is_promotable(struct symbol *type)
return 1;
case SYM_STRUCT:
case SYM_UNION:
- return type->bit_size <= long_ctype.bit_size;
+ if (type->bit_size > long_ctype.bit_size)
+ return 0;
+ FOR_EACH_PTR(type->symbol_list, member) {
+ if (!is_promotable(member))
+ return 0;
+ } END_FOR_EACH_PTR(member);
+ return 1;
default:
break;
}