diff options
author | pfg <pfg@FreeBSD.org> | 2012-07-14 20:24:00 +0000 |
---|---|---|
committer | pfg <pfg@FreeBSD.org> | 2012-07-14 20:24:00 +0000 |
commit | 8163e6ee8ce149bf2ae5eb4ff303205445de7b5b (patch) | |
tree | df73507288518a7fb66f37e5157048e557045a92 /cddl/contrib/opensolaris/lib/libdtrace | |
parent | 2044619bd43f4a327035bcdd208551210a000f2b (diff) | |
parent | 84258b1f15098e2a784fd3bd7d214416f1e97104 (diff) | |
download | FreeBSD-src-8163e6ee8ce149bf2ae5eb4ff303205445de7b5b.zip FreeBSD-src-8163e6ee8ce149bf2ae5eb4ff303205445de7b5b.tar.gz |
Merge illumos commit 13455:7205f7794835
1458 D compiler fails to generate error on sizeof() an undefined struct
Reference:
https://www.illumos.org/issues/1458
Tested by: Fabian Keil
MFC after: 3 weeks
Diffstat (limited to 'cddl/contrib/opensolaris/lib/libdtrace')
-rw-r--r-- | cddl/contrib/opensolaris/lib/libdtrace/common/dt_parser.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_parser.c b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_parser.c index b193286..aafe647 100644 --- a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_parser.c +++ b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_parser.c @@ -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, char *buf, size_t len) 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)); } |