Fix memory size not updating after growing in interpreter (#2898)

This commit fixes linear memory size not updating after growing.
This causes `memory.fill` to throw an exception after `memory.grow`.
This commit is contained in:
Yage Hu 2023-12-11 16:36:59 -08:00 committed by GitHub
parent 4aee3cf14e
commit ef0cd22119
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 2 deletions

View File

@ -2149,7 +2149,11 @@ wasm_interp_call_func_bytecode(WASMModuleInstance *module,
#if !defined(OS_ENABLE_HW_BOUND_CHECK) \
|| WASM_CPU_SUPPORTS_UNALIGNED_ADDR_ACCESS == 0 \
|| WASM_ENABLE_BULK_MEMORY != 0
linear_mem_size = get_linear_mem_size();
#if WASM_ENABLE_THREAD_MGR == 0
linear_mem_size = memory->memory_data_size;
#else
linear_mem_size = GET_LINEAR_MEMORY_SIZE(memory);
#endif
#endif
}

View File

@ -1917,7 +1917,11 @@ wasm_interp_call_func_bytecode(WASMModuleInstance *module,
#if !defined(OS_ENABLE_HW_BOUND_CHECK) \
|| WASM_CPU_SUPPORTS_UNALIGNED_ADDR_ACCESS == 0 \
|| WASM_ENABLE_BULK_MEMORY != 0
linear_mem_size = get_linear_mem_size();
#if WASM_ENABLE_THREAD_MGR == 0
linear_mem_size = memory->memory_data_size;
#else
linear_mem_size = GET_LINEAR_MEMORY_SIZE(memory);
#endif
#endif
}