Skip to content

Commit b62bbdd

Browse files
authored
[mono][interp] Properly initialize fields of LocalValue (#80795)
We were storing uninitialized values. Bug caught with valgrind, hopefully fixes some real crashes.
1 parent 6619e1b commit b62bbdd

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/mono/mono/mini/interp/transform.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8801,6 +8801,8 @@ interp_fold_unop (TransformData *td, LocalValue *local_defs, InterpInst *ins)
88018801
}
88028802

88038803
local_ref_count [sreg]--;
8804+
result.ins = ins;
8805+
result.ref_count = 0;
88048806
local_defs [dreg] = result;
88058807

88068808
return ins;
@@ -8978,6 +8980,8 @@ interp_fold_binop (TransformData *td, LocalValue *local_defs, InterpInst *ins, g
89788980

89798981
local_ref_count [sreg1]--;
89808982
local_ref_count [sreg2]--;
8983+
result.ins = ins;
8984+
result.ref_count = 0;
89818985
local_defs [dreg] = result;
89828986
return ins;
89838987
}

0 commit comments

Comments
 (0)