diff options
author | Sam Clegg <sbc@chromium.org> | 2019-11-18 11:42:50 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-11-18 11:42:50 -0800 |
commit | cc1edc0c12d2cf72aec34ae246ebd43bd681671c (patch) | |
tree | e114762e6113b30b638a877b9643e2212a1bf023 | |
parent | 8b554c8d21f3f9cd9d052ef91a370a032f75aba3 (diff) | |
download | wabt-cc1edc0c12d2cf72aec34ae246ebd43bd681671c.tar.gz wabt-cc1edc0c12d2cf72aec34ae246ebd43bd681671c.tar.bz2 wabt-cc1edc0c12d2cf72aec34ae246ebd43bd681671c.zip |
wasm-interp: Correctly report failure of start function (#1230)
We were printing the error message but returning success.
-rw-r--r-- | src/tools/wasm-interp.cc | 1 | ||||
-rw-r--r-- | test/interp/start-failure.txt | 9 |
2 files changed, 10 insertions, 0 deletions
diff --git a/src/tools/wasm-interp.cc b/src/tools/wasm-interp.cc index d9c0aa29..f1acfc88 100644 --- a/src/tools/wasm-interp.cc +++ b/src/tools/wasm-interp.cc @@ -220,6 +220,7 @@ static wabt::Result ReadAndRunModule(const char* module_filename) { } else { WriteResult(s_stdout_stream.get(), "error running start function", exec_result.result); + return wabt::Result::Error; } } return result; diff --git a/test/interp/start-failure.txt b/test/interp/start-failure.txt new file mode 100644 index 00000000..04b91762 --- /dev/null +++ b/test/interp/start-failure.txt @@ -0,0 +1,9 @@ +;;; TOOL: run-interp +;;; ERROR: 1 +(module + (func $start unreachable) + (start $start) +) +(;; STDOUT ;;; +error running start function: unreachable executed +;;; STDOUT ;;) |