Skip to content

Commit 371f6bd

Browse files
committed
libdtrace: Update typecast handling in the DIF code generator
- We don't want to downcast capability types. The emitted shifts will clear the tag bit of a valid capability. - Avoid assuming that probe arguments are 64 bits wide.
1 parent 94da265 commit 371f6bd

File tree

1 file changed

+4
-2
lines changed
  • cddl/contrib/opensolaris/lib/libdtrace/common

1 file changed

+4
-2
lines changed

cddl/contrib/opensolaris/lib/libdtrace/common/dt_cg.c

+4-2
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,8 @@ dt_cg_typecast(const dt_node_t *src, const dt_node_t *dst,
523523
dt_irlist_append(dlp,
524524
dt_cg_node_alloc(DT_LBL_NONE, instr));
525525
}
526-
} else if (dstsize != sizeof (uint64_t)) {
526+
} else if (dstsize != sizeof (uint64_t) &&
527+
dstsize != sizeof (uintcap_t)) {
527528
int n = sizeof (uint64_t) * NBBY - dstsize * NBBY;
528529

529530
dt_cg_setx(dlp, rg, n);
@@ -1301,7 +1302,8 @@ dt_cg_array_op(dt_node_t *dnp, dt_irlist_t *dlp, dt_regset_t *drp)
13011302
if (idp->di_id != DIF_VAR_ARGS || !dt_node_is_scalar(dnp))
13021303
return;
13031304

1304-
if ((size = dt_node_type_size(dnp)) == sizeof (uint64_t))
1305+
size = dt_node_type_size(dnp);
1306+
if (size == sizeof (uint64_t) || size == sizeof (uintcap_t))
13051307
return;
13061308

13071309
reg = dt_regset_alloc(drp);

0 commit comments

Comments
 (0)