Skip to content

Commit

Permalink
Fix %r0 register leak
Browse files Browse the repository at this point in the history
The dt_cg_load_var() function was not properly freeing the %r0 register
for by-ref loads.  This caused a spill/fill pair to be generated for the
dt_cg_check_notnull() invocation.

Signed-off-by: Kris Van Hees <kris.van.hees@oracle.com>
Reviewed-by: Eugene Loh <eugene.loh@oracle.com>
  • Loading branch information
kvanhees committed Dec 13, 2021
1 parent 107cbf3 commit 37364e9
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 @@ -2086,6 +2086,7 @@ dt_cg_load_var(dt_node_t *dst, dt_irlist_t *dlp, dt_regset_t *drp)

if (dst->dn_flags & DT_NF_REF) {
emit(dlp, BPF_MOV_REG(dst->dn_reg, BPF_REG_0));
dt_regset_free(drp, BPF_REG_0);
dt_cg_check_notnull(dlp, drp, dst->dn_reg);
} else {
size_t size = dt_node_type_size(dst);
Expand Down

0 comments on commit 37364e9

Please sign in to comment.