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
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D33700
This commit is contained in:
Mark Johnston 2021-12-31 12:55:01 -05:00
parent f04a096049
commit 963f5dc7a3

View File

@ -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;