dwarves: cu__find_struct_by_name should set id for non declarations

Bug introduced recently, fixed.

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
Arnaldo Carvalho de Melo 2009-03-12 20:34:07 -03:00
parent 41b1554715
commit 152277f667
1 changed files with 10 additions and 8 deletions

View File

@ -720,18 +720,20 @@ struct tag *cu__find_struct_by_name(const struct cu *self, const char *name,
type = tag__type(pos);
if (type->namespace.name == sname) {
if (type->declaration) {
if (include_decls) {
if (idp != NULL)
*idp = id;
return pos;
}
} else
return pos;
if (!type->declaration)
goto found;
if (include_decls)
goto found;
}
}
return NULL;
found:
if (idp != NULL)
*idp = id;
return pos;
}
struct tag *cus__find_struct_by_name(const struct cus *self,