Skip to content

Commit

Permalink
proc_exit-failure: use a bit more awkward exit code
Browse files Browse the repository at this point in the history
The exit code 1 is too generic:

* many of platforms have EXIT_FAILURE == 1.

* many of wasm engines exit with 1 on a unreachable trap.
  eg.
    wasm3
    iwasm (wasm-micro-runtime)
    wasmer
    toywasm
    wasm-interp (wabt)
    wasmedge

  Note: wasmtime using 134 is an exception.

Use a bit more awkward value instead to avoid succeeding with a luck.
  • Loading branch information
yamt authored and loganek committed Jan 3, 2023
1 parent c2669ed commit 6d4b574
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions tests/assemblyscript/testsuite/proc_exit-failure.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"exit_code": 1
}
"exit_code": 33
}
4 changes: 2 additions & 2 deletions tests/assemblyscript/testsuite/proc_exit-failure.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ import {
proc_exit
} from '@assemblyscript/wasi-shim/assembly/bindings/wasi_snapshot_preview1';

proc_exit(1);
unreachable();
proc_exit(33);
unreachable();

0 comments on commit 6d4b574

Please sign in to comment.