From 9b9e938bee7b41f026fa9aeee988a5bfc63d55ed Mon Sep 17 00:00:00 2001 From: Wenyong Huang Date: Thu, 20 Jun 2024 12:33:52 +0800 Subject: [PATCH] Fix compilation errors (#3549) The compilation errors were introduced by #3515 and occur in debug building when wasm mini loader is compiled or GC is enabled. And remove two wasm files in standalone test-running-modes case, which will be generated by run.sh. --- core/iwasm/compilation/aot_emit_aot_file.c | 4 ++-- core/iwasm/interpreter/wasm_mini_loader.c | 2 +- .../test-running-modes/wasm-apps/hello.wasm | Bin 187 -> 0 bytes .../test-running-modes/wasm-apps/mytest.wasm | Bin 537 -> 0 bytes 4 files changed, 3 insertions(+), 3 deletions(-) delete mode 100755 tests/standalone/test-running-modes/wasm-apps/hello.wasm delete mode 100755 tests/standalone/test-running-modes/wasm-apps/mytest.wasm diff --git a/core/iwasm/compilation/aot_emit_aot_file.c b/core/iwasm/compilation/aot_emit_aot_file.c index 373c9e93..2d2e54be 100644 --- a/core/iwasm/compilation/aot_emit_aot_file.c +++ b/core/iwasm/compilation/aot_emit_aot_file.c @@ -1977,7 +1977,7 @@ aot_emit_table_info(uint8 *buf, uint8 *buf_end, uint32 *p_offset, if (comp_ctx->enable_gc && comp_data->import_tables[i].table_type.elem_ref_type) { bh_assert(wasm_is_type_multi_byte_type( - comp_data->import_tables[i].elem_type)); + comp_data->import_tables[i].table_type.elem_type)); EMIT_U32(comp_data->import_tables[i] .table_type.elem_ref_type->ref_ht_common.heap_type); } @@ -2009,7 +2009,7 @@ aot_emit_table_info(uint8 *buf, uint8 *buf_end, uint32 *p_offset, if (comp_ctx->enable_gc) { if (comp_data->tables[i].table_type.elem_ref_type) { bh_assert(wasm_is_type_multi_byte_type( - comp_data->tables[i].elem_type)); + comp_data->tables[i].table_type.elem_type)); EMIT_U32( comp_data->tables[i] .table_type.elem_ref_type->ref_ht_common.heap_type); diff --git a/core/iwasm/interpreter/wasm_mini_loader.c b/core/iwasm/interpreter/wasm_mini_loader.c index dd0f0257..ad61f59e 100644 --- a/core/iwasm/interpreter/wasm_mini_loader.c +++ b/core/iwasm/interpreter/wasm_mini_loader.c @@ -684,7 +684,7 @@ load_table_import(const uint8 **p_buf, const uint8 *buf_end, read_leb_uint32(p, p_end, declare_init_size); if (declare_max_size_flag & 1) { read_leb_uint32(p, p_end, declare_max_size); - bh_assert(table->init_size <= table->max_size); + bh_assert(table->table_type.init_size <= table->table_type.max_size); } adjust_table_max_size(declare_init_size, declare_max_size_flag, diff --git a/tests/standalone/test-running-modes/wasm-apps/hello.wasm b/tests/standalone/test-running-modes/wasm-apps/hello.wasm deleted file mode 100755 index aedd4f4f2e9da4dc5fabd16a119548b810f273db..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 187 zcmXBJy$*sf6hPs7%TGZ}h(3XFa6t$z?mh{Yaz!Ggq%Da|IQrOVk486>Bx7;ArX*{r$?F*d*^8kKFV~_hN;s!Zn3i1iAmJuMmSw4$oTz)s+g{hA Mw^?MncF5`NetJzW{Qv*} diff --git a/tests/standalone/test-running-modes/wasm-apps/mytest.wasm b/tests/standalone/test-running-modes/wasm-apps/mytest.wasm deleted file mode 100755 index 68c9c9cf0d038e38c6427ce036b5de10ccf924b1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 537 zcmYk2&rTaL5XNV0XA`niS#deq8YMX3_0O+N+R*%N1TXg6+Qa= zzJMX)RIrtRukg=LzXP}ie1^Z?O`Y59f>^h^+eJ>JU;ctSE%>Va7iVE8&?S4}#jH** z__2YO3wM^Ma+#?){7{Y*|5@s6J_O&dtaj0=50kU=Z+(C(R>)l8VFxyVam$tjEmq1r zQN}#4?jFJ*j*XScO`f+NqqX6QvFAI+-YA)O<9%$4-*TVi8QH qL3rUD-HQ($-oTax%zkD`%M+EwXYZGjq~2%SAC#clJN|8;}kF