Change proc_exit to unwind the stack rather than exiting the host process. (#1646)
* Remove Cranelift's OutOfBounds trap, which is no longer used. * Change proc_exit to unwind instead of exit the host process. This implements the semantics in https://github.com/WebAssembly/WASI/pull/235. Fixes #783. Fixes #993. * Fix exit-status tests on Windows. * Revert the wiggle changes and re-introduce the wasi-common implementations. * Move `wasi_proc_exit` into the wasmtime-wasi crate. * Revert the spec_testsuite change. * Remove the old proc_exit implementations. * Make `TrapReason` an implementation detail. * Allow exit status 2 on Windows too. * Fix a documentation link. * Really fix a documentation link.
This commit is contained in:
@@ -30,7 +30,7 @@ fn loops_interruptable() -> anyhow::Result<()> {
|
||||
let iloop = instance.get_func("loop").unwrap().get0::<()>()?;
|
||||
store.interrupt_handle()?.interrupt();
|
||||
let trap = iloop().unwrap_err();
|
||||
assert!(trap.message().contains("wasm trap: interrupt"));
|
||||
assert!(trap.to_string().contains("wasm trap: interrupt"));
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@@ -44,9 +44,9 @@ fn functions_interruptable() -> anyhow::Result<()> {
|
||||
store.interrupt_handle()?.interrupt();
|
||||
let trap = iloop().unwrap_err();
|
||||
assert!(
|
||||
trap.message().contains("wasm trap: interrupt"),
|
||||
trap.to_string().contains("wasm trap: interrupt"),
|
||||
"{}",
|
||||
trap.message()
|
||||
trap.to_string()
|
||||
);
|
||||
Ok(())
|
||||
}
|
||||
@@ -91,9 +91,9 @@ fn loop_interrupt_from_afar() -> anyhow::Result<()> {
|
||||
let trap = iloop().unwrap_err();
|
||||
thread.join().unwrap();
|
||||
assert!(
|
||||
trap.message().contains("wasm trap: interrupt"),
|
||||
trap.to_string().contains("wasm trap: interrupt"),
|
||||
"bad message: {}",
|
||||
trap.message()
|
||||
trap.to_string()
|
||||
);
|
||||
Ok(())
|
||||
}
|
||||
@@ -127,9 +127,9 @@ fn function_interrupt_from_afar() -> anyhow::Result<()> {
|
||||
let trap = iloop().unwrap_err();
|
||||
thread.join().unwrap();
|
||||
assert!(
|
||||
trap.message().contains("wasm trap: interrupt"),
|
||||
trap.to_string().contains("wasm trap: interrupt"),
|
||||
"bad message: {}",
|
||||
trap.message()
|
||||
trap.to_string()
|
||||
);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user