Fix pointer unchecked issue in thread-mgr.c (#960)
And refine the code format of thread_manager.h
This commit is contained in:
@ -344,13 +344,13 @@ wasm_cluster_spawn_exec_env(WASMExecEnv *exec_env)
|
||||
{
|
||||
WASMCluster *cluster = wasm_exec_env_get_cluster(exec_env);
|
||||
wasm_module_inst_t module_inst = get_module_inst(exec_env);
|
||||
wasm_module_t module = wasm_exec_env_get_module(exec_env);
|
||||
wasm_module_t module;
|
||||
wasm_module_inst_t new_module_inst;
|
||||
WASMExecEnv *new_exec_env;
|
||||
uint32 aux_stack_start, aux_stack_size;
|
||||
uint32 stack_size = 8192;
|
||||
|
||||
if (!module) {
|
||||
if (!module_inst || !(module = wasm_exec_env_get_module(exec_env))) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -373,11 +373,9 @@ wasm_cluster_spawn_exec_env(WASMExecEnv *exec_env)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (module_inst) {
|
||||
/* Set custom_data to new module instance */
|
||||
wasm_runtime_set_custom_data_internal(
|
||||
new_module_inst, wasm_runtime_get_custom_data(module_inst));
|
||||
}
|
||||
/* Set custom_data to new module instance */
|
||||
wasm_runtime_set_custom_data_internal(
|
||||
new_module_inst, wasm_runtime_get_custom_data(module_inst));
|
||||
|
||||
new_exec_env = wasm_exec_env_create_internal(new_module_inst,
|
||||
exec_env->wasm_stack_size);
|
||||
|
||||
Reference in New Issue
Block a user