aot compiler: Fix the length type passed to aot_memmove/aot_memset (#3378)

The current length type of aot_memmove/aot_memset is size_t, and on
a 64 bit host it is uint64, while what the aot code passes to it is uint32,
this might lead to unexpected behavior.

ps. https://github.com/bytecodealliance/wasm-micro-runtime/pull/3376.
This commit is contained in:
Wenyong Huang
2024-05-01 21:40:52 +08:00
committed by GitHub
parent 163f29e51b
commit 835188cc53
4 changed files with 24 additions and 2 deletions

View File

@ -1973,10 +1973,12 @@ aot_set_llvm_basic_types(AOTLLVMTypes *basic_types, LLVMContextRef context,
if (pointer_size == 4) {
basic_types->intptr_t_type = basic_types->int32_type;
basic_types->intptr_t_ptr_type = basic_types->int32_ptr_type;
basic_types->size_t_type = basic_types->int32_type;
}
else {
basic_types->intptr_t_type = basic_types->int64_type;
basic_types->intptr_t_ptr_type = basic_types->int64_ptr_type;
basic_types->size_t_type = basic_types->int64_type;
}
basic_types->gc_ref_type = basic_types->int8_ptr_type;