From eb9da1ada8b6b2c74378a5c17029ec5a7fb199e6 Mon Sep 17 00:00:00 2001 From: Mark Johnston Date: Sat, 13 Aug 2016 19:51:00 +0000 Subject: Fix handling of forward enum declarations in the CTF tools. Reported by: mmacy MFC after: 2 weeks --- cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c | 5 +++++ cddl/contrib/opensolaris/tools/ctf/cvt/merge.c | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'cddl') diff --git a/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c b/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c index e439f04616af..cfcf627ab1af 100644 --- a/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c +++ b/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c @@ -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; diff --git a/cddl/contrib/opensolaris/tools/ctf/cvt/merge.c b/cddl/contrib/opensolaris/tools/ctf/cvt/merge.c index 5b22a31140d7..3dc2ad0cbdad 100644 --- a/cddl/contrib/opensolaris/tools/ctf/cvt/merge.c +++ b/cddl/contrib/opensolaris/tools/ctf/cvt/merge.c @@ -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 -- cgit v1.2.3