@@ -1391,15 +1391,22 @@ aot_call_function(WASMExecEnv *exec_env, AOTFunctionInstance *function,
13911391#ifdef OS_ENABLE_BLOCK_INSN_INTERRUPT
13921392 wasm_exec_env_push_jmpbuf (exec_env , & jmpbuf_node );
13931393 wasm_runtime_set_exec_env_tls (exec_env );
1394- if (os_setjmp (jmpbuf_node .jmpbuf ) == 0 )
1394+ if (os_setjmp (jmpbuf_node .jmpbuf ) == 0 ) {
13951395#endif
13961396 ret = invoke_native_internal (exec_env , function -> u .func .func_ptr ,
13971397 func_type , NULL , NULL , argv1 , argc ,
13981398 argv );
13991399#ifdef OS_ENABLE_BLOCK_INSN_INTERRUPT
1400+ }
1401+ else {
1402+ ret = false;
1403+ }
14001404
14011405 jmpbuf_node_pop = wasm_exec_env_pop_jmpbuf (exec_env );
14021406 bh_assert (& jmpbuf_node == jmpbuf_node_pop );
1407+ if (!exec_env -> jmpbuf_stack_top ) {
1408+ wasm_runtime_set_exec_env_tls (NULL );
1409+ }
14031410#endif
14041411
14051412#if WASM_ENABLE_DUMP_CALL_STACK != 0
@@ -1461,15 +1468,22 @@ aot_call_function(WASMExecEnv *exec_env, AOTFunctionInstance *function,
14611468#ifdef OS_ENABLE_BLOCK_INSN_INTERRUPT
14621469 wasm_exec_env_push_jmpbuf (exec_env , & jmpbuf_node );
14631470 wasm_runtime_set_exec_env_tls (exec_env );
1464- if (os_setjmp (jmpbuf_node .jmpbuf ) == 0 )
1471+ if (os_setjmp (jmpbuf_node .jmpbuf ) == 0 ) {
14651472#endif
14661473 ret =
14671474 invoke_native_internal (exec_env , function -> u .func .func_ptr ,
14681475 func_type , NULL , NULL , argv , argc , argv );
14691476#ifdef OS_ENABLE_BLOCK_INSN_INTERRUPT
1477+ }
1478+ else {
1479+ ret = false;
1480+ }
14701481
14711482 jmpbuf_node_pop = wasm_exec_env_pop_jmpbuf (exec_env );
14721483 bh_assert (& jmpbuf_node == jmpbuf_node_pop );
1484+ if (!exec_env -> jmpbuf_stack_top ) {
1485+ wasm_runtime_set_exec_env_tls (NULL );
1486+ }
14731487#endif
14741488
14751489#if WASM_ENABLE_DUMP_CALL_STACK != 0
0 commit comments