From 591b74057101fbb8ae91dc9ecc14a41684c2f325 Mon Sep 17 00:00:00 2001 From: "liang.he" Date: Tue, 10 Dec 2024 20:26:14 +0800 Subject: [PATCH] Consume the placeholders that were put when emitting table info (#3940) --- core/iwasm/aot/aot_loader.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/core/iwasm/aot/aot_loader.c b/core/iwasm/aot/aot_loader.c index dd26bbee..239e328b 100644 --- a/core/iwasm/aot/aot_loader.c +++ b/core/iwasm/aot/aot_loader.c @@ -1333,7 +1333,12 @@ load_import_table_list(const uint8 **p_buf, const uint8 *buf_end, if (wasm_is_type_multi_byte_type(import_table->table_type.elem_type)) { read_uint8(buf, buf_end, ref_type.ref_ht_common.nullable); } + else #endif + { + /* Skip 1 byte */ + buf += 1; + } read_uint32(buf, buf_end, import_table->table_type.init_size); read_uint32(buf, buf_end, import_table->table_type.max_size); #if WASM_ENABLE_GC != 0 @@ -1393,7 +1398,12 @@ load_table_list(const uint8 **p_buf, const uint8 *buf_end, AOTModule *module, if (wasm_is_type_multi_byte_type(table->table_type.elem_type)) { read_uint8(buf, buf_end, ref_type.ref_ht_common.nullable); } + else #endif + { + /* Skip 1 byte */ + buf += 1; + } read_uint32(buf, buf_end, table->table_type.init_size); read_uint32(buf, buf_end, table->table_type.max_size); #if WASM_ENABLE_GC != 0 @@ -1481,7 +1491,7 @@ load_table_init_data_list(const uint8 **p_buf, const uint8 *buf_end, else #endif { - /* Skip 8 byte for ref type info */ + /* Skip 8 byte(2+2+4) for ref type info */ buf += 8; }