aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Johnston <markj@FreeBSD.org>2021-12-31 17:55:01 +0000
committerMark Johnston <markj@FreeBSD.org>2022-01-07 14:03:02 +0000
commited0748f1a8fa064bea81c0c0068e78aa69ee5b0a (patch)
tree4f0620bafc4f4449c43c83dae8949912d71f2708
parent6d73b43abf2393ac3ab600f449038346ac08368e (diff)
downloadsrc-ed0748f1a8fa064bea81c0c0068e78aa69ee5b0a.tar.gz
src-ed0748f1a8fa064bea81c0c0068e78aa69ee5b0a.zip
ctfconvert: Handle arrays of empty structs
Members with such a type will legitimately have a size of zero, so don't emit a warning. PR: 260818 Reviewed by: bz Sponsored by: The FreeBSD Foundation (cherry picked from commit 963f5dc7a30624e95d72fb7f87b8892651164e46)
-rw-r--r--cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c b/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c
index 32c993e1e524..2d686e53fed1 100644
--- a/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c
+++ b/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c
@@ -1123,8 +1123,16 @@ die_sou_resolve(tdesc_t *tdp, tdesc_t **tdpp __unused, void *private)
*/
if (mt->t_members == NULL)
continue;
- if (mt->t_type == ARRAY && mt->t_ardef->ad_nelems == 0)
- continue;
+ if (mt->t_type == ARRAY) {
+ if (mt->t_ardef->ad_nelems == 0)
+ continue;
+ mt = tdesc_basetype(mt->t_ardef->ad_contents);
+ if ((mt->t_flags & TDESC_F_RESOLVED) != 0 &&
+ (mt->t_type == STRUCT ||
+ mt->t_type == UNION) &&
+ mt->t_members == NULL)
+ continue;
+ }
if ((mt->t_flags & TDESC_F_RESOLVED) != 0 &&
(mt->t_type == STRUCT || mt->t_type == UNION))
continue;