Implement wasm-c-api frame/trap APIs for interpreter mode (#660)

And enable to cache compiled AOT file buffer for wasm-c-api JIT mode
Avoid checks that rely on undefined C behavior
Fix issues of wasm-c-api sample trap and callback_chain

Signed-off-by: Wenyong Huang <wenyong.huang@intel.com>
This commit is contained in:
Wenyong Huang
2021-07-06 17:05:59 +08:00
committed by GitHub
parent d91047cc37
commit b554a9d05d
16 changed files with 576 additions and 104 deletions

View File

@ -1896,7 +1896,7 @@ aot_validate_app_addr(AOTModuleInstance *module_inst,
}
/* integer overflow check */
if(app_offset + size < app_offset) {
if(app_offset > UINT32_MAX - size) {
goto fail;
}
@ -1920,7 +1920,7 @@ aot_validate_native_addr(AOTModuleInstance *module_inst,
}
/* integer overflow check */
if (addr + size < addr) {
if ((uintptr_t)addr > UINTPTR_MAX - size) {
goto fail;
}