hot: fix preserve instance

This commit is contained in:
Edward Amsden 2023-12-13 19:46:39 -06:00
parent 38c1b3cef3
commit b841fe2f63

View File

@ -830,7 +830,7 @@ struct HotMem {
impl Preserve for Hot { impl Preserve for Hot {
unsafe fn preserve(&mut self, stack: &mut NockStack) { unsafe fn preserve(&mut self, stack: &mut NockStack) {
let mut it = self; let mut it = self;
while !it.0.is_null() && !stack.is_in_frame(it.0) { while !it.0.is_null() && stack.is_in_frame(it.0) {
let dest_mem = stack.struct_alloc_in_previous_frame(1); let dest_mem = stack.struct_alloc_in_previous_frame(1);
copy_nonoverlapping(it.0, dest_mem, 1); copy_nonoverlapping(it.0, dest_mem, 1);
it.0 = dest_mem; it.0 = dest_mem;