From nobody Fri Dec 31 18:09:18 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 86BE019237C8; Fri, 31 Dec 2021 18:09:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4JQY7L4MFDz3hv3; Fri, 31 Dec 2021 18:09:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 12A0310599; Fri, 31 Dec 2021 18:09:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1BVI9Iup035130; Fri, 31 Dec 2021 18:09:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1BVI9IU3035129; Fri, 31 Dec 2021 18:09:18 GMT (envelope-from git) Date: Fri, 31 Dec 2021 18:09:18 GMT Message-Id: <202112311809.1BVI9IU3035129@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 963f5dc7a306 - main - ctfconvert: Handle arrays of empty structs List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 963f5dc7a30624e95d72fb7f87b8892651164e46 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1640974158; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=R6ktKRVOVk4zreyt0ytsrjA/9+IdrdroYliXvUpHlDY=; b=KoC1p6ueqS2o6tNW6R6+SN4NCGVV2MqbgSyekYA54GTlUM9IfvmTfhm8pm4E+rtaMkjuR0 CbVx/8ioWOgTXYp5gyw8uRERH6rWypAtPTbq31/eopNOIJHDmLwI2VS8I7IQBFFyaChNoR um2/riy1iNkKbbPQjqroJlWb9J8pl2AI6RjLl111NcqHVTwUIU00Am3eRgH4bvSZv7RnJa 9u80p1m7Er4Jn9n78cla4gf+lNyT03URG3Uin3Rt49cTikcwwCwMpTzmpepRmonl2n5otU KBW2lqfJ8cQ/k3r5JVNvYd+Eri9gRfTZHdzY9V/IUxUOdDKj9a1o9KECFULhuw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1640974158; a=rsa-sha256; cv=none; b=xpc0MjcPpioVJ7FRcRYnw6AKwwj8cMaiGNwN40ACjEZhv0oXUnkPVB2L/fMG0s+3uNGzj0 ixznQcwNPv1V0OOLGjAAG1xYCRyOb2CibJ4rSNkVNG3K3MV9d65nx+wiB+UtZIfsaXjc1e YWkj7HnU2e1Fkv1u7OOE7ICEZ1q/WO/4s2MspCm5K2oScQdswdJ15uh3XAmTGMl3uDorOd WMeSEHmHCmb8qAxCQqCfpNGJriLgh8T95fRbFyNHTERie1uDj6Iyqd28qR7uG5z6htht33 QsR9h5a3QPBYl2mcLwXR2YpAWlr+9rXu6nko0e1LDKGcXTcqr2x0M7Be3VITmw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=963f5dc7a30624e95d72fb7f87b8892651164e46 commit 963f5dc7a30624e95d72fb7f87b8892651164e46 Author: Mark Johnston AuthorDate: 2021-12-31 17:55:01 +0000 Commit: Mark Johnston CommitDate: 2021-12-31 17:55:01 +0000 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 --- cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c | 12 ++++++++++-- 1 file 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;