Skip to content

Commit

Permalink
cg: fix calls to rand
Browse files Browse the repository at this point in the history
For many types of identifier, a di_id of 0 means "undefined".  But for
subrs, di_id 0 is DIF_SUBR_RAND, a valid (albeit currently
unimplemented) subr.

Fixes several assertion failures running the testsute.

Signed-off-by: Nick Alcock <nick.alcock@oracle.com>
Reviewed-by: Kris Van Hees <kris.van.hees@oracle.com>
  • Loading branch information
nickalcock authored and kvanhees committed Sep 29, 2021
1 parent 8d2f51b commit ccbf8bd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libdtrace/dt_cg.c
Original file line number Diff line number Diff line change
Expand Up @@ -3325,7 +3325,7 @@ dt_cg_call_subr(dt_node_t *dnp, dt_irlist_t *dlp, dt_regset_t *drp)
"required)\n",
dt_idkind_name(idp->di_kind), idp->di_name);

assert(idp->di_id > 0 && idp->di_id <= DIF_SUBR_MAX);
assert(idp->di_id <= DIF_SUBR_MAX);

fun = _dt_cg_subr[idp->di_id];
if (fun == NULL)
Expand Down

0 comments on commit ccbf8bd

Please sign in to comment.