From nobody Fri Jan 07 14:03:26 2022 X-Original-To: dev-commits-src-branches@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 E97D51923882; Fri, 7 Jan 2022 14:03:26 +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 4JVlLQ4Y9sz4s0v; Fri, 7 Jan 2022 14:03:26 +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 7BCAC49B1; Fri, 7 Jan 2022 14:03:26 +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 207E3QqK075389; Fri, 7 Jan 2022 14:03:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 207E3Qg3075388; Fri, 7 Jan 2022 14:03:26 GMT (envelope-from git) Date: Fri, 7 Jan 2022 14:03:26 GMT Message-Id: <202201071403.207E3Qg3075388@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: ed0748f1a8fa - stable/13 - ctfconvert: Handle arrays of empty structs List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: ed0748f1a8fa064bea81c0c0068e78aa69ee5b0a Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1641564206; 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=0Q0zVPn78BfHHjm0RK7dyAK3x/EZjWRBgDXEvNxN9pU=; b=Hd2t5p5FZlYUQsS1m12BMoGjjF54hWv1f1I/xjGODrlWRjyw5uuRXEv+UVjTxCcH2VUoMx ucxre3ckVdpJ1Q1zyAzJInXG3DLzbgPxzTJFlnAO42NiNaBzhWkMEdO7KDICuk3AOGfeSJ TUn4/PUngNNa4C4pM+SRYNAbuyPo1N7ATWTX3OxtALFwckmE3qKuvGlMAqnW9rIwX5U96j Rr0mNxYcY26M3oy/R/D9vEDYD2xSTr3lL8yoPLZu/spffDLpC3dNxmcfuQ45pANPQoQPFE 1U66CIPrK3a4YlJsOWpaFz2grWDdpPMAaX3llDcn6OEAibxq2BC/ikaCHZsl7w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1641564206; a=rsa-sha256; cv=none; b=Ee0ICojQmjtJ/7E5mIYl03H/lzYjb1V5xL4PwmPDScGiS6pWaxAj968AQq22WcMBQepqnq ztPqJPao725aS/dQ8RnYBYo82wk+daFq1pJjTO2RJ1yX+6JTX2xBtPl/FZ/JzolkgD6ROR wJKTtRUThg9YPxg/mbPNJa8r5kEN2CCRqQWWaGDzruWWu/a6grz5sG8VxljU2II5KzSw3c 68Ma7XsQjcby7j8+SIRFji0OfnpPSpOW9nvUrrv9gABXMmXOFmnDmPGHM8WFLuTyknfWW5 DU6XW6skDRfD5DX/yKo82ar4zw2aOFNL2l4WCXHbJCSkMW6RcOmJSIMo2JISCg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=ed0748f1a8fa064bea81c0c0068e78aa69ee5b0a commit ed0748f1a8fa064bea81c0c0068e78aa69ee5b0a Author: Mark Johnston AuthorDate: 2021-12-31 17:55:01 +0000 Commit: Mark Johnston CommitDate: 2022-01-07 14:03:02 +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 Sponsored by: The FreeBSD Foundation (cherry picked from commit 963f5dc7a30624e95d72fb7f87b8892651164e46) --- 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;