Fix handling of forward enum declarations in the CTF tools.

Reported by:	mmacy
MFC after:	2 weeks
This commit is contained in:
Mark Johnston 2016-08-13 19:51:00 +00:00
parent 842ee21e20
commit eb9da1ada8
2 changed files with 7 additions and 1 deletions

View File

@ -816,6 +816,11 @@ die_enum_create(dwarf_t *dw, Dwarf_Die die, Dwarf_Off off, tdesc_t *tdp)
Dwarf_Unsigned uval;
Dwarf_Signed sval;
if (die_isdecl(dw, die)) {
tdp->t_type = FORWARD;
return;
}
debug(3, "die %llu: creating enum\n", off);
tdp->t_type = ENUM;

View File

@ -338,7 +338,8 @@ fwd_equiv(tdesc_t *ctdp, tdesc_t *mtdp)
{
tdesc_t *defn = (ctdp->t_type == FORWARD ? mtdp : ctdp);
return (defn->t_type == STRUCT || defn->t_type == UNION);
return (defn->t_type == STRUCT || defn->t_type == UNION ||
defn->t_type == ENUM);
}
static int