* dwarf2read.c (read_subroutine_type): Add the subroutine type to the

die immediately to allow a parameter type to be the same subroutine type.
This commit is contained in:
Gaius Mulley
2009-12-16 15:09:43 +00:00
parent 25ac7f26dd
commit 76c10ea2bb
2 changed files with 12 additions and 1 deletions

View File

@@ -5879,6 +5879,11 @@ read_subroutine_type (struct die_info *die, struct dwarf2_cu *cu)
the default value DW_CC_normal. */
attr = dwarf2_attr (die, DW_AT_calling_convention, cu);
TYPE_CALLING_CONVENTION (ftype) = attr ? DW_UNSND (attr) : DW_CC_normal;
/* We need to add the subroutine type to the die immediately so
we don't infinitely recurse when dealing with parameters
declared as the same subroutine type. */
set_die_type (die, ftype, cu);
if (die->child != NULL)
{
@@ -5926,7 +5931,7 @@ read_subroutine_type (struct die_info *die, struct dwarf2_cu *cu)
}
}
return set_die_type (die, ftype, cu);
return ftype;
}
static struct type *