From 6d4b57497ceacd304e35a7ab03dd9bb65950bd79 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Wed, 21 Dec 2022 17:07:11 +0900 Subject: [PATCH] proc_exit-failure: use a bit more awkward exit code 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. --- tests/assemblyscript/testsuite/proc_exit-failure.json | 4 ++-- tests/assemblyscript/testsuite/proc_exit-failure.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/assemblyscript/testsuite/proc_exit-failure.json b/tests/assemblyscript/testsuite/proc_exit-failure.json index 07689a10..f781a01d 100644 --- a/tests/assemblyscript/testsuite/proc_exit-failure.json +++ b/tests/assemblyscript/testsuite/proc_exit-failure.json @@ -1,3 +1,3 @@ { - "exit_code": 1 -} \ No newline at end of file + "exit_code": 33 +} diff --git a/tests/assemblyscript/testsuite/proc_exit-failure.ts b/tests/assemblyscript/testsuite/proc_exit-failure.ts index 987c5e06..bd66ef86 100644 --- a/tests/assemblyscript/testsuite/proc_exit-failure.ts +++ b/tests/assemblyscript/testsuite/proc_exit-failure.ts @@ -2,5 +2,5 @@ import { proc_exit } from '@assemblyscript/wasi-shim/assembly/bindings/wasi_snapshot_preview1'; - proc_exit(1); - unreachable(); \ No newline at end of file + proc_exit(33); + unreachable();