mirror of
https://github.com/bytecodealliance/wasm-micro-runtime.git
synced 2025-06-07 05:39:16 +00:00
handle nullable heap reference types in import section (#4302)
This commit is contained in:
parent
6a00874f2f
commit
93ef19b0ca
|
@ -3282,6 +3282,13 @@ load_import_section(const uint8 *buf, const uint8 *buf_end, WASMModule *module,
|
||||||
CHECK_BUF(p, p_end, 1);
|
CHECK_BUF(p, p_end, 1);
|
||||||
/* 0x70 */
|
/* 0x70 */
|
||||||
u8 = read_uint8(p);
|
u8 = read_uint8(p);
|
||||||
|
#if WASM_ENABLE_GC != 0
|
||||||
|
if (wasm_is_reftype_htref_nullable(u8)) {
|
||||||
|
int32 heap_type;
|
||||||
|
read_leb_int32(p, p_end, heap_type);
|
||||||
|
(void)heap_type;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
read_leb_uint32(p, p_end, flags);
|
read_leb_uint32(p, p_end, flags);
|
||||||
read_leb_uint32(p, p_end, u32);
|
read_leb_uint32(p, p_end, u32);
|
||||||
if (flags & 1)
|
if (flags & 1)
|
||||||
|
@ -3329,7 +3336,7 @@ load_import_section(const uint8 *buf, const uint8 *buf_end, WASMModule *module,
|
||||||
/* valtype */
|
/* valtype */
|
||||||
CHECK_BUF(p, p_end, 1);
|
CHECK_BUF(p, p_end, 1);
|
||||||
global_type = read_uint8(p);
|
global_type = read_uint8(p);
|
||||||
if (wasm_is_type_multi_byte_type(global_type)) {
|
if (wasm_is_reftype_htref_nullable(global_type)) {
|
||||||
int32 heap_type;
|
int32 heap_type;
|
||||||
read_leb_int32(p, p_end, heap_type);
|
read_leb_int32(p, p_end, heap_type);
|
||||||
(void)heap_type;
|
(void)heap_type;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user