mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2026-08-27 00:26:02 -04:00
Use check_typedef in two spots
I found a couple of spots that were manually unwrapping typedefs. This won't work properly if a stub type is involved. This patch changes these places to use check_typedef. I have no way to test these targets though. Reviewed-By: Tom de Vries <tdevries@suse.de>
This commit is contained in:
parent
113db462a3
commit
2ad494911f
2 changed files with 3 additions and 7 deletions
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue