diff --git a/external/cddl/osnet/dist/tools/ctf/cvt/dwarf.c b/external/cddl/osnet/dist/tools/ctf/cvt/dwarf.c index 17ec494d320d..81a9eca3373d 100644 --- a/external/cddl/osnet/dist/tools/ctf/cvt/dwarf.c +++ b/external/cddl/osnet/dist/tools/ctf/cvt/dwarf.c @@ -782,7 +782,8 @@ die_array_resolve(tdesc_t *tdp, tdesc_t **tdpp __unused, void *private) debug(3, "trying to resolve array %d (cont %d)\n", tdp->t_id, tdp->t_ardef->ad_contents->t_id); - if ((sz = tdesc_size(tdp->t_ardef->ad_contents)) == 0) { + if ((sz = tdesc_size(tdp->t_ardef->ad_contents)) == 0 && + (tdp->t_ardef->ad_contents->t_flags & TDESC_F_RESOLVED) == 0) { debug(3, "unable to resolve array %s (%d) contents %d\n", tdesc_name(tdp), tdp->t_id, tdp->t_ardef->ad_contents->t_id); @@ -1164,12 +1165,17 @@ die_sou_resolve(tdesc_t *tdp, tdesc_t **tdpp __unused, void *private) /* * For empty members, or GCC/C99 flexible array - * members, a size of 0 is correct. + * members, a size of 0 is correct. Structs and unions + * consisting of flexible array members will also have + * size 0. */ if (mt->t_members == NULL) continue; if (mt->t_type == ARRAY && mt->t_ardef->ad_nelems == 0) continue; + if ((mt->t_flags & TDESC_F_RESOLVED) != 0 && + (mt->t_type == STRUCT || mt->t_type == UNION)) + continue; if (mt->t_type == STRUCT && mt->t_members != NULL &&