Skip to content

Commit

Permalink
cg: fix ++/-- dynvar storage
Browse files Browse the repository at this point in the history
This function mocks up a fake right hand side for dt_cg_store_var(), but the
fakery is only partial, and it fails to initialize dn_kind, which
dt_cg_store_var() then relies upon.  We usually survive, but it's still
using random junk off the stack.

Fix trivial.

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 Mar 6, 2024
1 parent ea3d28f commit 2c72eff
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions libdtrace/dt_cg.c
Original file line number Diff line number Diff line change
Expand Up @@ -4350,6 +4350,7 @@ dt_cg_incdec_op(dt_node_t *dnp, dt_irlist_t *dlp, dt_regset_t *drp, uint_t op,
* so we fake one here.
*/
val.dn_op = DT_TOK_INT;
val.dn_kind = DT_NODE_INT;
val.dn_value = op == BPF_ADD ? adj : -adj;

lbl_dflt = dt_irlist_label(dlp);
Expand Down

0 comments on commit 2c72eff

Please sign in to comment.