core: function__tag_fprintf should check if the alias name is NULL

Only seen in some C++ inline expansion cases. Will appear as "(null)" in the
rendered source code.

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
Arnaldo Carvalho de Melo 2009-03-24 19:03:56 -03:00
parent e924cacdf6
commit a386913705
1 changed files with 4 additions and 1 deletions

View File

@ -1860,8 +1860,11 @@ static size_t function__tag_fprintf(const struct tag *tag, const struct cu *cu,
printed = fprintf(fp, "%.*s", indent, tabs);
name = function__name(alias, cu);
n = fprintf(fp, "%s", name);
size_t namelen = 0;
if (name != NULL)
namelen = strlen(name);
n += ftype__fprintf_parms(&alias->proto, cu,
indent + (strlen(name) + 7) / 8,
indent + (namelen + 7) / 8,
fp);
n += fprintf(fp, "; /* size=%zd, low_pc=%#llx */",
exp->size, (unsigned long long)exp->low_pc);