Page MenuHomeFreeBSD

D48254.diff
No OneTemporary

D48254.diff

diff --git a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_parser.c b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_parser.c
--- a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_parser.c
+++ b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_parser.c
@@ -1130,6 +1130,29 @@
lp_is_void = ctf_type_encoding(lfp, lref, &e) == 0 && IS_VOID(e);
rp_is_void = ctf_type_encoding(rfp, rref, &e) == 0 && IS_VOID(e);
+ /*
+ * Let a pointer to a forward declaration be compatible with a pointer
+ * to a struct or union of the same name.
+ */
+ if (lkind == CTF_K_POINTER && rkind == CTF_K_POINTER) {
+ int lrkind, rrkind;
+
+ lrkind = ctf_type_kind(lfp, lref);
+ rrkind = ctf_type_kind(rfp, rref);
+ if (lrkind == CTF_K_FORWARD || rrkind == CTF_K_FORWARD) {
+ const char *lname, *rname;
+ char ln[DT_TYPE_NAMELEN], rn[DT_TYPE_NAMELEN];
+
+ lname = ctf_type_name(lfp, lref, ln, sizeof (ln));
+ rname = ctf_type_name(rfp, rref, rn, sizeof (rn));
+ if (lname != NULL && rname != NULL &&
+ strcmp(lname, rname) == 0) {
+ lp_is_void = lrkind == CTF_K_FORWARD;
+ rp_is_void = rrkind == CTF_K_FORWARD;
+ }
+ }
+ }
+
/*
* The types are compatible if both are pointers to the same type, or
* if either pointer is a void pointer. If they are compatible, set

File Metadata

Mime Type
text/plain
Expires
Thu, Jan 16, 1:02 PM (20 h, 41 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
15642959
Default Alt Text
D48254.diff (1 KB)

Event Timeline