summaryrefslogtreecommitdiff
path: root/src/tools
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/wasm-ctor-eval.cpp6
-rw-r--r--src/tools/wasm-shell.cpp3
2 files changed, 9 insertions, 0 deletions
diff --git a/src/tools/wasm-ctor-eval.cpp b/src/tools/wasm-ctor-eval.cpp
index ca0dafd8e..7ef52dd5f 100644
--- a/src/tools/wasm-ctor-eval.cpp
+++ b/src/tools/wasm-ctor-eval.cpp
@@ -291,6 +291,12 @@ struct CtorEvalExternalInterface : EvallingModuleInstance::ExternalInterface {
throw FailToEvalException(std::string("trap: ") + why);
}
+ void throwException(Literal exn) override {
+ std::stringstream ss;
+ ss << "exception thrown: " << exn;
+ throw FailToEvalException(ss.str());
+ }
+
private:
// TODO: handle unaligned too, see shell-interface
diff --git a/src/tools/wasm-shell.cpp b/src/tools/wasm-shell.cpp
index 301da6cac..1430c1891 100644
--- a/src/tools/wasm-shell.cpp
+++ b/src/tools/wasm-shell.cpp
@@ -209,6 +209,9 @@ static void run_asserts(Name moduleName,
result = operation.operate();
} catch (const TrapException&) {
trapped = true;
+ } catch (const WasmException& e) {
+ std::cout << "[exception thrown: " << e.exn << "]" << std::endl;
+ trapped = true;
}
if (id == ASSERT_RETURN) {
assert(!trapped);