Browse Source

Fix a maybe-uninitialized use warning (#1370)

When `OS_ENABLE_HW_BOUND_CHECK` isn't defined and
`WASM_ENABLE_THREAD_MGR == 0`, the `exec_env` is used
without initialization.
Xu Jun 3 năm trước cách đây
mục cha
commit
4653de90d2
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      core/iwasm/interpreter/wasm_runtime.c

+ 1 - 1
core/iwasm/interpreter/wasm_runtime.c

@@ -2032,7 +2032,7 @@ wasm_create_exec_env_and_call_function(WASMModuleInstance *module_inst,
                                        unsigned argc, uint32 argv[],
                                        bool enable_debug)
 {
-    WASMExecEnv *exec_env, *existing_exec_env = NULL;
+    WASMExecEnv *exec_env = NULL, *existing_exec_env = NULL;
     bool ret;
 
 #if defined(OS_ENABLE_HW_BOUND_CHECK)