Fix compile warnings/error reported in Windows (#3616)

Clear some compile warnings and fix undefined reference error for symbol ffs
in Windows platform.
This commit is contained in:
Wenyong Huang
2024-07-12 16:43:22 +08:00
committed by GitHub
parent 46695b992c
commit 73caf19e69
11 changed files with 49 additions and 23 deletions

View File

@ -5644,8 +5644,14 @@ wasm_interp_call_func_bytecode(WASMModuleInstance *module,
#endif
/* allowing the destination and source to overlap */
#if WASM_ENABLE_MEMORY64 == 0
bh_memmove_s(mdst, (uint32)(linear_mem_size - dst),
msrc, len);
msrc, (uint32)len);
#else
/* use memmove when memory64 is enabled since len
may be larger than UINT32_MAX */
memmove(mdst, msrc, len);
#endif
break;
}
case WASM_OP_MEMORY_FILL:

View File

@ -1608,7 +1608,7 @@ execute_malloc_function(WASMModuleInstance *module_inst, WASMExecEnv *exec_env,
if (ret) {
#if WASM_ENABLE_MEMORY64 != 0
if (is_memory64)
*p_result = GET_I64_FROM_ADDR(&argv.u64);
*p_result = argv.u64;
else
#endif
{
@ -2184,8 +2184,8 @@ wasm_instantiate(WASMModule *module, WASMModuleInstance *parent,
heap_size = APP_HEAP_SIZE_MAX;
module_inst_mem_inst_size =
(uint64)sizeof(WASMMemoryInstance)
* (module->import_memory_count + module->memory_count);
sizeof(WASMMemoryInstance)
* ((uint64)module->import_memory_count + module->memory_count);
#if WASM_ENABLE_JIT != 0
/* If the module doesn't have memory, reserve one mem_info space
@ -2615,7 +2615,7 @@ wasm_instantiate(WASMModule *module, WASMModuleInstance *parent,
if (memory_data) {
bh_memcpy_s(memory_data + base_offset,
(uint32)memory_size - base_offset, data_seg->data,
(uint32)(memory_size - base_offset), data_seg->data,
length);
}
}