@@ -1955,33 +1955,6 @@ wasm_runtime_finalize_call_function(WASMExecEnv *exec_env,
19551955}
19561956#endif
19571957
1958- static bool
1959- clear_wasi_proc_exit_exception (WASMModuleInstanceCommon * module_inst_comm )
1960- {
1961- #if WASM_ENABLE_LIBC_WASI != 0
1962- bool has_exception ;
1963- char exception [EXCEPTION_BUF_LEN ];
1964- WASMModuleInstance * module_inst = (WASMModuleInstance * )module_inst_comm ;
1965-
1966- bh_assert (module_inst_comm -> module_type == Wasm_Module_Bytecode
1967- || module_inst_comm -> module_type == Wasm_Module_AoT );
1968-
1969- has_exception = wasm_copy_exception (module_inst , exception );
1970- if (has_exception && !strcmp (exception , "Exception: wasi proc exit" )) {
1971- /* The "wasi proc exit" exception is thrown by native lib to
1972- let wasm app exit, which is a normal behavior, we clear
1973- the exception here. And just clear the exception of current
1974- thread, don't call `wasm_set_exception(module_inst, NULL)`
1975- which will clear the exception of all threads. */
1976- module_inst -> cur_exception [0 ] = '\0' ;
1977- return true;
1978- }
1979- return false;
1980- #else
1981- return false;
1982- #endif
1983- }
1984-
19851958bool
19861959wasm_runtime_call_wasm (WASMExecEnv * exec_env ,
19871960 WASMFunctionInstanceCommon * function , uint32 argc ,
@@ -2022,15 +1995,10 @@ wasm_runtime_call_wasm(WASMExecEnv *exec_env,
20221995 param_argc , new_argv );
20231996#endif
20241997 if (!ret ) {
2025- if (clear_wasi_proc_exit_exception (exec_env -> module_inst )) {
2026- ret = true;
2027- }
2028- else {
2029- if (new_argv != argv ) {
2030- wasm_runtime_free (new_argv );
2031- }
2032- return false;
1998+ if (new_argv != argv ) {
1999+ wasm_runtime_free (new_argv );
20332000 }
2001+ return false;
20342002 }
20352003
20362004#if WASM_ENABLE_REF_TYPES != 0
@@ -4611,10 +4579,6 @@ wasm_runtime_call_indirect(WASMExecEnv *exec_env, uint32 element_index,
46114579 ret = aot_call_indirect (exec_env , 0 , element_index , argc , argv );
46124580#endif
46134581
4614- if (!ret && clear_wasi_proc_exit_exception (exec_env -> module_inst )) {
4615- ret = true;
4616- }
4617-
46184582 return ret ;
46194583}
46204584
0 commit comments