Handle the case where DW_TAG_subroutine_type has no DW_AT_type, meaning

it doesn't have a return value, i.e. it "returns" void.

Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
This commit is contained in:
Arnaldo Carvalho de Melo 2006-10-25 00:27:29 -03:00
parent 3e4d70ad47
commit 034dafb614
1 changed files with 12 additions and 8 deletions

View File

@ -185,16 +185,20 @@ unsigned long class_member__print(struct class_member *self)
if (ptr_class != NULL &&
ptr_class->tag == DW_TAG_subroutine_type) {
struct class *ret_class = find_class_by_type(ptr_class->type);
/* function has no return value (void) */
if (ptr_class->type == 0)
strcpy(bf, "void");
else {
struct class *ret_class = find_class_by_type(ptr_class->type);
if (ret_class != NULL) {
class_name = class__name(ret_class,
class_name_bf,
sizeof(class_name_bf));
snprintf(member_name_bf, sizeof(member_name_bf),
"(*%s)();", self->name);
goto out;
if (ret_class != NULL)
class_name = class__name(ret_class,
class_name_bf,
sizeof(class_name_bf));
}
snprintf(member_name_bf, sizeof(member_name_bf),
"(*%s)();", self->name);
goto out;
}
}