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:
8
tests/wasm/exit125_wasi_snapshot0.wat
Normal file
8
tests/wasm/exit125_wasi_snapshot0.wat
Normal file
@@ -0,0 +1,8 @@
|
||||
(module
|
||||
(import "wasi_unstable" "proc_exit"
|
||||
(func $__wasi_proc_exit (param i32)))
|
||||
(func $_start
|
||||
(call $__wasi_proc_exit (i32.const 125))
|
||||
)
|
||||
(export "_start" (func $_start))
|
||||
)
|
||||
8
tests/wasm/exit125_wasi_snapshot1.wat
Normal file
8
tests/wasm/exit125_wasi_snapshot1.wat
Normal file
@@ -0,0 +1,8 @@
|
||||
(module
|
||||
(import "wasi_snapshot_preview1" "proc_exit"
|
||||
(func $__wasi_proc_exit (param i32)))
|
||||
(func $_start
|
||||
(call $__wasi_proc_exit (i32.const 125))
|
||||
)
|
||||
(export "_start" (func $_start))
|
||||
)
|
||||
8
tests/wasm/exit126_wasi_snapshot0.wat
Normal file
8
tests/wasm/exit126_wasi_snapshot0.wat
Normal file
@@ -0,0 +1,8 @@
|
||||
(module
|
||||
(import "wasi_unstable" "proc_exit"
|
||||
(func $__wasi_proc_exit (param i32)))
|
||||
(func $_start
|
||||
(call $__wasi_proc_exit (i32.const 126))
|
||||
)
|
||||
(export "_start" (func $_start))
|
||||
)
|
||||
8
tests/wasm/exit126_wasi_snapshot1.wat
Normal file
8
tests/wasm/exit126_wasi_snapshot1.wat
Normal file
@@ -0,0 +1,8 @@
|
||||
(module
|
||||
(import "wasi_snapshot_preview1" "proc_exit"
|
||||
(func $__wasi_proc_exit (param i32)))
|
||||
(func $_start
|
||||
(call $__wasi_proc_exit (i32.const 126))
|
||||
)
|
||||
(export "_start" (func $_start))
|
||||
)
|
||||
8
tests/wasm/exit2_wasi_snapshot0.wat
Normal file
8
tests/wasm/exit2_wasi_snapshot0.wat
Normal file
@@ -0,0 +1,8 @@
|
||||
(module
|
||||
(import "wasi_unstable" "proc_exit"
|
||||
(func $__wasi_proc_exit (param i32)))
|
||||
(func $_start
|
||||
(call $__wasi_proc_exit (i32.const 2))
|
||||
)
|
||||
(export "_start" (func $_start))
|
||||
)
|
||||
8
tests/wasm/exit2_wasi_snapshot1.wat
Normal file
8
tests/wasm/exit2_wasi_snapshot1.wat
Normal file
@@ -0,0 +1,8 @@
|
||||
(module
|
||||
(import "wasi_snapshot_preview1" "proc_exit"
|
||||
(func $__wasi_proc_exit (param i32)))
|
||||
(func $_start
|
||||
(call $__wasi_proc_exit (i32.const 2))
|
||||
)
|
||||
(export "_start" (func $_start))
|
||||
)
|
||||
Reference in New Issue
Block a user