diff --git a/gdb/iq2000-tdep.c b/gdb/iq2000-tdep.c index 748227d8e43..32e3750aca4 100644 --- a/gdb/iq2000-tdep.c +++ b/gdb/iq2000-tdep.c @@ -597,8 +597,7 @@ iq2000_pass_8bytetype_by_address (struct type *type) struct type *ftype; /* Skip typedefs. */ - while (type->code () == TYPE_CODE_TYPEDEF) - type = type->target_type (); + type = check_typedef (type); /* Non-struct and non-union types are always passed by value. */ if (type->code () != TYPE_CODE_STRUCT && type->code () != TYPE_CODE_UNION) @@ -612,8 +611,7 @@ iq2000_pass_8bytetype_by_address (struct type *type) if (ftype->length () != 8) return 1; /* Skip typedefs of field type. */ - while (ftype->code () == TYPE_CODE_TYPEDEF) - ftype = ftype->target_type (); + ftype = check_typedef (ftype); /* If field is int or float, pass by value. */ if (ftype->code () == TYPE_CODE_FLT || ftype->code () == TYPE_CODE_INT) diff --git a/gdb/mn10300-tdep.c b/gdb/mn10300-tdep.c index a05007c6b11..e74f3567428 100644 --- a/gdb/mn10300-tdep.c +++ b/gdb/mn10300-tdep.c @@ -134,6 +134,7 @@ mn10300_use_struct_convention (struct type *type) { /* Structures bigger than a pair of words can't be returned in registers. */ + type = check_typedef (type); if (type->length () > 8) return 1; @@ -159,9 +160,6 @@ mn10300_use_struct_convention (struct type *type) case TYPE_CODE_ARRAY: return 1; - case TYPE_CODE_TYPEDEF: - return mn10300_use_struct_convention (check_typedef (type)); - default: return 0; }