Implement aux stack overflow/underflow check for AOT/interp (#601)

This commit is contained in:
Wenyong Huang
2021-04-07 16:15:59 +08:00
committed by GitHub
parent fe76c89c25
commit 77c3ddf7d0
18 changed files with 242 additions and 45 deletions

View File

@ -384,8 +384,7 @@ wasm_cluster_destroy_spawned_exec_env(WASMExecEnv *exec_env)
bh_assert(cluster != NULL);
/* Free aux stack space */
free_aux_stack(cluster,
exec_env->aux_stack_boundary + cluster->stack_size);
free_aux_stack(cluster, exec_env->aux_stack_bottom.bottom);
wasm_cluster_del_exec_env(cluster, exec_env);
wasm_exec_env_destroy_internal(exec_env);
@ -411,8 +410,7 @@ thread_manager_start_routine(void *arg)
/* Routine exit */
/* Free aux stack space */
free_aux_stack(cluster,
exec_env->aux_stack_boundary + cluster->stack_size);
free_aux_stack(cluster, exec_env->aux_stack_bottom.bottom);
/* Detach the native thread here to ensure the resources are freed */
wasm_cluster_detach_thread(exec_env);
/* Remove and destroy exec_env */
@ -519,8 +517,7 @@ wasm_cluster_exit_thread(WASMExecEnv *exec_env, void *retval)
/* App exit the thread, free the resources before exit native thread */
/* Free aux stack space */
free_aux_stack(cluster,
exec_env->aux_stack_boundary + cluster->stack_size);
free_aux_stack(cluster, exec_env->aux_stack_bottom.bottom);
/* Detach the native thread here to ensure the resources are freed */
wasm_cluster_detach_thread(exec_env);
/* Remove and destroy exec_env */