From e2b0a2a26eac53661964739c2be344c90850626d Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Wed, 4 Nov 2015 21:33:02 -0800 Subject: trap on i2f overflow --- src/wasm-shell.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/wasm-shell.cpp') diff --git a/src/wasm-shell.cpp b/src/wasm-shell.cpp index 81e6112ce..1f8d1373c 100644 --- a/src/wasm-shell.cpp +++ b/src/wasm-shell.cpp @@ -35,12 +35,6 @@ struct ShellExternalInterface : ModuleInstance::ExternalInterface { } } - jmp_buf trapState; - - void trap() { - longjmp(trapState, 1); - } - Literal callImport(Import *import, ModuleInstance::LiteralList& arguments) override { if (import->name == PRINT) { for (auto argument : arguments) { @@ -97,6 +91,12 @@ struct ShellExternalInterface : ModuleInstance::ExternalInterface { default: abort(); } } + + jmp_buf trapState; + + void trap() override { + longjmp(trapState, 1); + } }; int main(int argc, char **argv) { -- cgit v1.2.3