Fix some compilation warnings and enable Windows JIT (#586)
This commit is contained in:
@ -574,7 +574,7 @@ load_table_init_data_list(const uint8 **p_buf, const uint8 *buf_end,
|
||||
data_list[i]->offset.init_expr_type = (uint8)init_expr_type;
|
||||
data_list[i]->offset.u.i64 = (int64)init_expr_value;
|
||||
data_list[i]->func_index_count = func_index_count;
|
||||
read_byte_array(buf, buf_end, data_list[i]->func_indexes, size1);
|
||||
read_byte_array(buf, buf_end, data_list[i]->func_indexes, (uint32)size1);
|
||||
}
|
||||
|
||||
*p_buf = buf;
|
||||
@ -1444,7 +1444,7 @@ do_text_relocation(AOTModule *module,
|
||||
bh_memcpy_s(xmm_buf, sizeof(xmm_buf),
|
||||
symbol + strlen(XMM_PLT_PREFIX) + 16, 16);
|
||||
if (!str2uint64(xmm_buf, (uint64*)symbol_addr)) {
|
||||
set_error_buf_v(error_buf, error_buf,
|
||||
set_error_buf_v(error_buf, error_buf_size,
|
||||
"resolve symbol %s failed", symbol);
|
||||
goto check_symbol_fail;
|
||||
}
|
||||
@ -1452,7 +1452,7 @@ do_text_relocation(AOTModule *module,
|
||||
bh_memcpy_s(xmm_buf, sizeof(xmm_buf),
|
||||
symbol + strlen(XMM_PLT_PREFIX), 16);
|
||||
if (!str2uint64(xmm_buf, (uint64*)((uint8*)symbol_addr + 8))) {
|
||||
set_error_buf_v(error_buf, error_buf,
|
||||
set_error_buf_v(error_buf, error_buf_size,
|
||||
"resolve symbol %s failed", symbol);
|
||||
goto check_symbol_fail;
|
||||
}
|
||||
@ -1468,7 +1468,7 @@ do_text_relocation(AOTModule *module,
|
||||
bh_memcpy_s(real_buf, sizeof(real_buf),
|
||||
symbol + strlen(REAL_PLT_PREFIX), 16);
|
||||
if (!str2uint64(real_buf, (uint64*)symbol_addr)) {
|
||||
set_error_buf_v(error_buf, error_buf,
|
||||
set_error_buf_v(error_buf, error_buf_size,
|
||||
"resolve symbol %s failed", symbol);
|
||||
goto check_symbol_fail;
|
||||
}
|
||||
@ -1484,7 +1484,7 @@ do_text_relocation(AOTModule *module,
|
||||
bh_memcpy_s(float_buf, sizeof(float_buf),
|
||||
symbol + strlen(REAL_PLT_PREFIX), 8);
|
||||
if (!str2uint32(float_buf, (uint32*)symbol_addr)) {
|
||||
set_error_buf_v(error_buf, error_buf,
|
||||
set_error_buf_v(error_buf, error_buf_size,
|
||||
"resolve symbol %s failed", symbol);
|
||||
goto check_symbol_fail;
|
||||
}
|
||||
@ -2306,7 +2306,8 @@ aot_load_from_comp_data(AOTCompData *comp_data, AOTCompContext *comp_ctx,
|
||||
goto fail1;
|
||||
}
|
||||
|
||||
bh_memcpy_s(module->memories, size, comp_data->memories, size);
|
||||
bh_memcpy_s(module->memories, (uint32)size,
|
||||
comp_data->memories, (uint32)size);
|
||||
}
|
||||
|
||||
module->mem_init_data_list = comp_data->mem_init_data_list;
|
||||
|
||||
@ -777,7 +777,7 @@ wasm_runtime_deinstantiate_internal(WASMModuleInstanceCommon *module_inst,
|
||||
void
|
||||
wasm_runtime_deinstantiate(WASMModuleInstanceCommon *module_inst)
|
||||
{
|
||||
return wasm_runtime_deinstantiate_internal(module_inst, false);
|
||||
wasm_runtime_deinstantiate_internal(module_inst, false);
|
||||
}
|
||||
|
||||
WASMExecEnv *
|
||||
@ -1962,7 +1962,7 @@ wasm_runtime_init_wasi(WASMModuleInstanceCommon *module_inst,
|
||||
|
||||
fail:
|
||||
if (envp)
|
||||
wasm_runtime_free(envp);
|
||||
wasm_runtime_free((void*)envp);
|
||||
|
||||
if (init_options.preopens)
|
||||
wasm_runtime_free(init_options.preopens);
|
||||
|
||||
@ -83,7 +83,7 @@ aot_compile_simd_i8x16_arith(AOTCompContext *comp_ctx,
|
||||
|
||||
return simd_v128_integer_arith(comp_ctx, func_ctx, arith_op, lhs, rhs);
|
||||
fail:
|
||||
return NULL;
|
||||
return false;
|
||||
}
|
||||
|
||||
bool
|
||||
@ -105,7 +105,7 @@ aot_compile_simd_i16x8_arith(AOTCompContext *comp_ctx,
|
||||
|
||||
return simd_v128_integer_arith(comp_ctx, func_ctx, arith_op, lhs, rhs);
|
||||
fail:
|
||||
return NULL;
|
||||
return false;
|
||||
}
|
||||
|
||||
bool
|
||||
@ -127,7 +127,7 @@ aot_compile_simd_i32x4_arith(AOTCompContext *comp_ctx,
|
||||
|
||||
return simd_v128_integer_arith(comp_ctx, func_ctx, arith_op, lhs, rhs);
|
||||
fail:
|
||||
return NULL;
|
||||
return false;
|
||||
}
|
||||
|
||||
bool
|
||||
|
||||
@ -1909,8 +1909,8 @@ wasm_enlarge_memory(WASMModuleInstance *module, uint32 inc_page_count)
|
||||
return false;
|
||||
|
||||
memory_data = memory->memory_data;
|
||||
heap_size = memory->heap_data_end - memory->heap_data;
|
||||
total_size_old = memory->memory_data_end - memory_data;
|
||||
heap_size = (uint32)(memory->heap_data_end - memory->heap_data);
|
||||
total_size_old = (uint32)(memory->memory_data_end - memory_data);
|
||||
total_page_count = inc_page_count + memory->cur_page_count;
|
||||
total_size = memory->num_bytes_per_page * (uint64)total_page_count;
|
||||
heap_data_old = memory->heap_data;
|
||||
|
||||
@ -647,7 +647,7 @@ static uint32
|
||||
strcpy_wrapper(wasm_exec_env_t exec_env, char *dst, const char *src)
|
||||
{
|
||||
wasm_module_inst_t module_inst = get_module_inst(exec_env);
|
||||
uint32 len = strlen(src) + 1;
|
||||
uint32 len = (uint32)strlen(src) + 1;
|
||||
|
||||
/* src has been checked by runtime */
|
||||
if (!validate_native_addr(dst, len))
|
||||
@ -712,7 +712,7 @@ free_wrapper(wasm_exec_env_t exec_env, void *ptr)
|
||||
if (!validate_native_addr(ptr, sizeof(uint32)))
|
||||
return;
|
||||
|
||||
return module_free(addr_native_to_app(ptr));
|
||||
module_free(addr_native_to_app(ptr));
|
||||
}
|
||||
|
||||
static int32
|
||||
|
||||
Reference in New Issue
Block a user