Skip to content

Commit

Permalink
[mono][interp] Ensure new var value has initialized liveness information
Browse files Browse the repository at this point in the history
  • Loading branch information
BrzVlad committed Apr 11, 2024
1 parent cf821eb commit 30dc24f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/mono/mono/mini/interp/transform-opt.c
Original file line number Diff line number Diff line change
Expand Up @@ -2241,6 +2241,7 @@ interp_fold_unop (TransformData *td, InterpInst *ins)
td->var_values [sreg].ref_count--;
result.def = ins;
result.ref_count = td->var_values [dreg].ref_count; // preserve ref count
result.liveness = td->var_values [dreg].liveness;
td->var_values [dreg] = result;

return ins;
Expand Down Expand Up @@ -2478,6 +2479,7 @@ interp_fold_binop (TransformData *td, InterpInst *ins, gboolean *folded)
td->var_values [sreg2].ref_count--;
result.def = ins;
result.ref_count = td->var_values [dreg].ref_count; // preserve ref count
result.liveness = td->var_values [dreg].liveness;
td->var_values [dreg] = result;

return ins;
Expand Down

0 comments on commit 30dc24f

Please sign in to comment.