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

@ -981,8 +981,10 @@ load_function_section(const uint8 *buf, const uint8 *buf_end,
local_type_index = 0;
for (j = 0; j < local_set_count; j++) {
read_leb_uint32(p_code, buf_code_end, sub_local_count);
bh_assert(!(local_type_index + sub_local_count <= local_type_index
|| local_type_index + sub_local_count > local_count));
bh_assert(sub_local_count
&& local_type_index <= UINT32_MAX - sub_local_count
&& local_type_index + sub_local_count
<= local_count);
CHECK_BUF(p_code, buf_code_end, 1);
/* 0x7F/0x7E/0x7D/0x7C */