Fix several AOT compiler issues (#2697)

- Fix potential invalid push param phis and add incoming phis to a un-existed basic block
- Fix potential invalid shift count int rotl/rotr opcodes
- Resize memory_data_size to UINT32_MAX if it is 4G when hw bound check is enabled
- Fix negative linear memory offset is used for 64-bit target it is const and larger than INT32_MAX
This commit is contained in:
Wenyong Huang
2023-11-02 20:36:21 +08:00
committed by GitHub
parent 0b2313f6f8
commit 68a627ea2c
5 changed files with 37 additions and 6 deletions

View File

@ -554,8 +554,12 @@ memory_instantiate(AOTModuleInstance *module_inst, AOTModuleInstance *parent,
os_munmap(mapped_mem, map_size);
return NULL;
}
/* Newly allocated pages are filled with zero by the OS, we don't fill it
* again here */
if (memory_data_size > UINT32_MAX)
memory_data_size = UINT32_MAX;
#endif /* end of OS_ENABLE_HW_BOUND_CHECK */
memory_inst->module_type = Wasm_Module_AoT;