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:
Xu Jun
2022-08-08 11:15:30 +08:00
committed by GitHub
parent 0020b3ae68
commit 4b00432c1a
4 changed files with 62 additions and 0 deletions

View File

@ -89,6 +89,18 @@ wasm_interp_call_wasm(struct WASMModuleInstance *module_inst,
struct WASMFunctionInstance *function, uint32 argc,
uint32 argv[]);
/**
* @brief Restore the wasm stack frame to the last native frame or the begging
* of the whole stack
* @note e.g. for stack "begin --> interp --> interp", it will back to the
* "begin", for stack "begin --> interp --> native --> interp", it will become
* "begin --> interp --> native"
*
* @param exec_env the execution environment
*/
void
wasm_interp_restore_wasm_frame(struct WASMExecEnv *exec_env);
#ifdef __cplusplus
}
#endif