Skip to content

Commit 5205c88

Browse files
committed
Fix potential GC crash related to OP_RECV_MARKER_RESERVE
This bug could potentially yield a crash with current GC/memory implementation, however it was not observed. Signed-off-by: Paul Guyot <[email protected]>
1 parent 1950aaa commit 5205c88

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/libAtomVM/opcodesswitch.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6195,6 +6195,10 @@ static bool maybe_call_native(Context *ctx, AtomString module_name, AtomString f
61956195
dreg_type_t reg_a_type;
61966196
DECODE_DEST_REGISTER(reg_a, reg_a_type, code, i, next_off);
61976197
TRACE("recv_marker_reserve/1: reg1=%c%i\n", T_DEST_REG(reg_a_type, reg_a));
6198+
#ifdef IMPL_EXECUTE_LOOP
6199+
// Clear register to avoid any issue with GC
6200+
WRITE_REGISTER(reg_a_type, reg_a, term_nil());
6201+
#endif
61986202
NEXT_INSTRUCTION(next_off);
61996203
break;
62006204
}

0 commit comments

Comments
 (0)