Fix dump call stack issue in interpreter (#1358)
Fix dump call stack issue in interpreter introduced by hw bound check: the call stack isn't dumped if the exception is thrown and caught by signal handler. And restore the wasm stack frame to the original status after calling a wasm function.
This commit is contained in:
@ -1986,6 +1986,15 @@ call_wasm_with_hw_bound_check(WASMModuleInstance *module_inst,
|
||||
ret = false;
|
||||
}
|
||||
|
||||
if (wasm_get_exception(module_inst)) {
|
||||
#if WASM_ENABLE_DUMP_CALL_STACK != 0
|
||||
if (wasm_interp_create_call_stack(exec_env)) {
|
||||
wasm_interp_dump_call_stack(exec_env, true, NULL, 0);
|
||||
}
|
||||
#endif
|
||||
wasm_interp_restore_wasm_frame(exec_env);
|
||||
}
|
||||
|
||||
jmpbuf_node_pop = wasm_exec_env_pop_jmpbuf(exec_env);
|
||||
bh_assert(&jmpbuf_node == jmpbuf_node_pop);
|
||||
if (!exec_env->jmpbuf_stack_top) {
|
||||
|
||||
Reference in New Issue
Block a user