diff --git a/src/wasmtime/crates/lind-multi-process/src/lib.rs b/src/wasmtime/crates/lind-multi-process/src/lib.rs index ae4b59c6b..dc5a5aef4 100644 --- a/src/wasmtime/crates/lind-multi-process/src/lib.rs +++ b/src/wasmtime/crates/lind-multi-process/src/lib.rs @@ -356,7 +356,7 @@ impl< // word), making start > end and firing the bounds-check ud2 every time. *(unwind_data_start_sys as *mut u32) = (unwind_data_start_usr + UNWIND_METADATA_SIZE) as u32; - *((unwind_data_start_sys + 4) as *mut u32) = stack_pointer as u32; + *((unwind_data_start_sys + 4) as *mut u32) = stack_pointer; } let get_cx = self.get_cx.clone(); @@ -887,7 +887,7 @@ impl< unsafe { *(parent_unwind_data_start_sys as *mut u32) = (parent_unwind_data_start_usr + UNWIND_METADATA_SIZE) as u32; - *((parent_unwind_data_start_sys + 4) as *mut u32) = stack_pointer as u32; + *((parent_unwind_data_start_sys + 4) as *mut u32) = stack_pointer; } // set up child_tid @@ -968,7 +968,7 @@ impl< store.set_on_called(Box::new(move |mut store| { // once unwind is finished, buf[0] (u32) holds the final write position let parent_unwind_data_end_usr = - unsafe { *(parent_unwind_data_start_sys as *mut u32) } as u64; + unsafe { *(parent_unwind_data_start_sys as *const u32) } as u64; // unwind finished and we need to stop the unwind let _res = asyncify_stop_unwind_func.call(&mut store, ()); @@ -1459,7 +1459,7 @@ impl< unsafe { *(parent_unwind_data_start_sys as *mut u32) = (parent_unwind_data_start_usr + UNWIND_METADATA_SIZE) as u32; - *((parent_unwind_data_start_sys + 4) as *mut u32) = stack_pointer as u32; + *((parent_unwind_data_start_sys + 4) as *mut u32) = stack_pointer; } // mark the start of unwind @@ -1580,7 +1580,7 @@ impl< unsafe { *(parent_unwind_data_start_sys as *mut u32) = (parent_unwind_data_start_usr + UNWIND_METADATA_SIZE) as u32; - *((parent_unwind_data_start_sys + 4) as *mut u32) = stack_pointer as u32; + *((parent_unwind_data_start_sys + 4) as *mut u32) = stack_pointer; } // mark the start of unwind @@ -1655,7 +1655,7 @@ impl< unsafe { *(unwind_data_start_sys as *mut u32) = (unwind_data_start_usr + UNWIND_METADATA_SIZE) as u32; - *((unwind_data_start_sys + 4) as *mut u32) = stack_pointer as u32; + *((unwind_data_start_sys + 4) as *mut u32) = stack_pointer; } // mark the start of unwind @@ -1673,7 +1673,7 @@ impl< let store = caller.as_context_mut().0; store.set_on_called(Box::new(move |mut store| { // once unwind is finished, buf[0] (u32) holds the final write position - let unwind_data_end_usr = unsafe { *(unwind_data_start_sys as *mut u32) } as u64; + let unwind_data_end_usr = unsafe { *(unwind_data_start_sys as *const u32) } as u64; // unwind finished and we need to stop the unwind let _res = asyncify_stop_unwind_func.call(&mut store, ()); @@ -1683,8 +1683,10 @@ impl< // store the unwind data let hash = store.store_unwind_data(unwind_data_start_sys as *const u8, rewind_total_size); + + let jmp_buf_sys = cloned_address + jmp_buf as u64; unsafe { - std::ptr::write_unaligned((cloned_address + jmp_buf as u64) as *mut u64, hash); + std::ptr::write_unaligned(jmp_buf_sys as *mut u64, hash); } // mark the parent to rewind state @@ -1733,7 +1735,7 @@ impl< unsafe { *(unwind_data_start_sys as *mut u32) = (unwind_data_start_usr + UNWIND_METADATA_SIZE) as u32; - *((unwind_data_start_sys + 4) as *mut u32) = stack_pointer as u32; + *((unwind_data_start_sys + 4) as *mut u32) = stack_pointer; } // mark the start of unwind @@ -1753,8 +1755,8 @@ impl< // unwind finished and we need to stop the unwind let _res = asyncify_stop_unwind_func.call(&mut store, ()); - let hash = - unsafe { std::ptr::read_unaligned((cloned_address + jmp_buf as u64) as *mut u64) }; + let jmp_buf_sys = cloned_address + jmp_buf as u64; + let hash = unsafe { std::ptr::read_unaligned(jmp_buf_sys as *const u64) }; // retrieve the unwind data let data = store.retrieve_unwind_data(hash);