Skip to content
This repository was archived by the owner on Sep 8, 2025. It is now read-only.

Commit 0327ee5

Browse files
authored
Merge pull request #211 from bytecodealliance/dicej/swap-stack-chain
swap `stack_chain` fields in `CallThreadState::swap`
2 parents be73e2e + 17b7a80 commit 0327ee5

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

crates/wasmtime/src/runtime/vm/traphandlers.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -587,8 +587,8 @@ mod call_thread_state {
587587

588588
#[cfg(feature = "async")]
589589
pub(crate) unsafe fn swap(&self) {
590-
unsafe fn swap(a: &core::cell::UnsafeCell<usize>, b: &mut usize) {
591-
*a.get() = core::mem::replace(b, *a.get());
590+
unsafe fn swap<T: Clone>(a: &core::cell::UnsafeCell<T>, b: &mut T) {
591+
*a.get() = core::mem::replace(b, (*a.get()).clone());
592592
}
593593

594594
let cx = self.vm_store_context.as_ref();
@@ -604,6 +604,7 @@ mod call_thread_state {
604604
&cx.last_wasm_entry_fp,
605605
&mut (*self.old_state).last_wasm_entry_fp,
606606
);
607+
swap(&cx.stack_chain, &mut (*self.old_state).stack_chain);
607608
}
608609
}
609610
}

0 commit comments

Comments
 (0)