diff options
author | Alon Zakai <alonzakai@gmail.com> | 2016-03-23 16:10:35 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2016-03-23 16:10:35 -0700 |
commit | 359c895db53b99fd176aac926914ecebcb4ddd93 (patch) | |
tree | 48cbe7e6e0e6af110cd5bac26df8f87fc6f09a0d /src/wasm-js.cpp | |
parent | a67434f2dd05f7590c2b7ab18b6bf9d6215f79f2 (diff) | |
parent | 85959a42f97857491bac46a25e9634029f6eb3b4 (diff) | |
download | binaryen-359c895db53b99fd176aac926914ecebcb4ddd93.tar.gz binaryen-359c895db53b99fd176aac926914ecebcb4ddd93.tar.bz2 binaryen-359c895db53b99fd176aac926914ecebcb4ddd93.zip |
Merge pull request #275 from WebAssembly/closure-fix
Test suite corner case fixes
Diffstat (limited to 'src/wasm-js.cpp')
-rw-r--r-- | src/wasm-js.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/wasm-js.cpp b/src/wasm-js.cpp index 03eddd031..d978e4a2a 100644 --- a/src/wasm-js.cpp +++ b/src/wasm-js.cpp @@ -382,6 +382,18 @@ extern "C" void EMSCRIPTEN_KEEPALIVE instantiate() { }; instance = new ModuleInstance(*module, new JSExternalInterface()); + + // stack trace hooks + EM_ASM({ + Module['outside']['extraStackTrace'] = function() { + return Pointer_stringify(Module['_interpreter_stack_trace']()); + }; + }); +} + +extern "C" int EMSCRIPTEN_KEEPALIVE interpreter_stack_trace() { + std::string stack = instance->printFunctionStack(); + return (int)strdup(stack.c_str()); // XXX leak } // Does a call from js into an export of the module. |