@@ -6156,9 +6156,7 @@ load_from_sections(WASMModule *module, WASMSection *sections,
61566156 }
61576157
61586158 if (!module->possible_memory_grow) {
6159- WASMMemoryImport *memory_import;
6160- WASMMemory *memory;
6161-
6159+ #if WASM_ENABLE_SHRUNK_MEMORY != 0
61626160 if (aux_data_end_global && aux_heap_base_global
61636161 && aux_stack_top_global) {
61646162 uint64 init_memory_size;
@@ -6168,7 +6166,8 @@ load_from_sections(WASMModule *module, WASMSection *sections,
61686166 * valid range of uint32 */
61696167 if (shrunk_memory_size <= UINT32_MAX) {
61706168 if (module->import_memory_count) {
6171- memory_import = &module->import_memories[0].u.memory;
6169+ WASMMemoryImport *memory_import =
6170+ &module->import_memories[0].u.memory;
61726171 init_memory_size =
61736172 (uint64)memory_import->mem_type.num_bytes_per_page
61746173 * memory_import->mem_type.init_page_count;
@@ -6183,7 +6182,7 @@ load_from_sections(WASMModule *module, WASMSection *sections,
61836182 }
61846183
61856184 if (module->memory_count) {
6186- memory = &module->memories[0];
6185+ WASMMemory * memory = &module->memories[0];
61876186 init_memory_size = (uint64)memory->num_bytes_per_page
61886187 * memory->init_page_count;
61896188 if (shrunk_memory_size <= init_memory_size) {
@@ -6196,10 +6195,12 @@ load_from_sections(WASMModule *module, WASMSection *sections,
61966195 }
61976196 }
61986197 }
6198+ #endif /* WASM_ENABLE_SHRUNK_MEMORY != 0 */
61996199
62006200#if WASM_ENABLE_MULTI_MODULE == 0
62016201 if (module->import_memory_count) {
6202- memory_import = &module->import_memories[0].u.memory;
6202+ WASMMemoryImport *memory_import =
6203+ &module->import_memories[0].u.memory;
62036204 /* Only resize the memory to one big page if num_bytes_per_page is
62046205 * in valid range of uint32 */
62056206 if (memory_import->mem_type.init_page_count < DEFAULT_MAX_PAGES) {
@@ -6215,7 +6216,7 @@ load_from_sections(WASMModule *module, WASMSection *sections,
62156216 }
62166217 }
62176218 if (module->memory_count) {
6218- memory = &module->memories[0];
6219+ WASMMemory * memory = &module->memories[0];
62196220 /* Only resize(shrunk) the memory size if num_bytes_per_page is in
62206221 * valid range of uint32 */
62216222 if (memory->init_page_count < DEFAULT_MAX_PAGES) {
@@ -10021,7 +10022,8 @@ check_memory_access_align(uint8 opcode, uint32 align, char *error_buf,
1002110022 bh_assert(opcode >= WASM_OP_I32_LOAD && opcode <= WASM_OP_I64_STORE32);
1002210023 if (align > mem_access_aligns[opcode - WASM_OP_I32_LOAD]) {
1002310024 set_error_buf(error_buf, error_buf_size,
10024- "alignment must not be larger than natural");
10025+ "invalid memop flags: alignment must not be larger "
10026+ "than natural");
1002510027 return false;
1002610028 }
1002710029 return true;
@@ -10060,7 +10062,8 @@ check_simd_memory_access_align(uint8 opcode, uint32 align, char *error_buf,
1006010062 && align > mem_access_aligns_load_lane[opcode
1006110063 - SIMD_v128_load8_lane])) {
1006210064 set_error_buf(error_buf, error_buf_size,
10063- "alignment must not be larger than natural");
10065+ "invalid memop flags: alignment must not be larger "
10066+ "than natural");
1006410067 return false;
1006510068 }
1006610069
0 commit comments