From owner-svn-src-stable-8@FreeBSD.ORG Tue Aug 21 21:11:59 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B18BA1065689; Tue, 21 Aug 2012 21:11:59 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9A7B38FC1C; Tue, 21 Aug 2012 21:11:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7LLBxH9007144; Tue, 21 Aug 2012 21:11:59 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7LLBxx4007141; Tue, 21 Aug 2012 21:11:59 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201208212111.q7LLBxx4007141@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Tue, 21 Aug 2012 21:11:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239539 - in stable/8/cddl/contrib/opensolaris: cmd/dtrace/test/tst/common/sizeof lib/libdtrace/common X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Aug 2012 21:11:59 -0000 Author: pfg Date: Tue Aug 21 21:11:59 2012 New Revision: 239539 URL: http://svn.freebsd.org/changeset/base/239539 Log: MFC 238457: 1458 D compiler fails to generate error on sizeof() an undefined struct Reference: https://www.illumos.org/issues/1458 Obtained from: Illumos Added: stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sizeof/err.D_SIZEOF_TYPE.badstruct.d - copied unchanged from r238457, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sizeof/err.D_SIZEOF_TYPE.badstruct.d Modified: stable/8/cddl/contrib/opensolaris/lib/libdtrace/common/dt_parser.c Directory Properties: stable/8/cddl/contrib/opensolaris/ (props changed) Copied: stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sizeof/err.D_SIZEOF_TYPE.badstruct.d (from r238457, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sizeof/err.D_SIZEOF_TYPE.badstruct.d) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sizeof/err.D_SIZEOF_TYPE.badstruct.d Tue Aug 21 21:11:59 2012 (r239539, copy of r238457, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sizeof/err.D_SIZEOF_TYPE.badstruct.d) @@ -0,0 +1,30 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright (c) 2011, Joyent Inc. All rights reserved. + */ + +BEGIN +{ + trace(sizeof (struct suckitlarry)); + exit(0); +} Modified: stable/8/cddl/contrib/opensolaris/lib/libdtrace/common/dt_parser.c ============================================================================== --- stable/8/cddl/contrib/opensolaris/lib/libdtrace/common/dt_parser.c Tue Aug 21 21:11:35 2012 (r239538) +++ stable/8/cddl/contrib/opensolaris/lib/libdtrace/common/dt_parser.c Tue Aug 21 21:11:59 2012 (r239539) @@ -22,7 +22,7 @@ /* * Copyright 2006 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. + * Copyright (c) 2011, Joyent Inc. All rights reserved. */ #pragma ident "%Z%%M% %I% %E% SMI" @@ -725,12 +725,19 @@ dt_node_type_name(const dt_node_t *dnp, size_t dt_node_type_size(const dt_node_t *dnp) { + ctf_id_t base; + if (dnp->dn_kind == DT_NODE_STRING) return (strlen(dnp->dn_string) + 1); if (dt_node_is_dynamic(dnp) && dnp->dn_ident != NULL) return (dt_ident_size(dnp->dn_ident)); + base = ctf_type_resolve(dnp->dn_ctfp, dnp->dn_type); + + if (ctf_type_kind(dnp->dn_ctfp, base) == CTF_K_FORWARD) + return (0); + return (ctf_type_size(dnp->dn_ctfp, dnp->dn_type)); }