From 6426fc4993478288f05a04827118cb27551a1b1e Mon Sep 17 00:00:00 2001 From: Maks Litskevich Date: Wed, 23 Oct 2024 07:48:40 +0100 Subject: [PATCH] Fix out of bounds issues after memory.grow on non-aot non-threads builds (#3872) Co-authored-by: Deniz Sokmen --- core/iwasm/interpreter/wasm_interp_classic.c | 2 +- core/iwasm/interpreter/wasm_interp_fast.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/iwasm/interpreter/wasm_interp_classic.c b/core/iwasm/interpreter/wasm_interp_classic.c index 41bfbe26d2..7041fd89c0 100644 --- a/core/iwasm/interpreter/wasm_interp_classic.c +++ b/core/iwasm/interpreter/wasm_interp_classic.c @@ -6727,7 +6727,7 @@ wasm_interp_call_func_bytecode(WASMModuleInstance *module, || WASM_CPU_SUPPORTS_UNALIGNED_ADDR_ACCESS == 0 \ || WASM_ENABLE_BULK_MEMORY != 0 if (memory) - linear_mem_size = get_linear_mem_size(); + linear_mem_size = GET_LINEAR_MEMORY_SIZE(memory); #endif if (wasm_copy_exception(module, NULL)) { #if WASM_ENABLE_EXCE_HANDLING != 0 diff --git a/core/iwasm/interpreter/wasm_interp_fast.c b/core/iwasm/interpreter/wasm_interp_fast.c index 82b6ff71bd..531468282f 100644 --- a/core/iwasm/interpreter/wasm_interp_fast.c +++ b/core/iwasm/interpreter/wasm_interp_fast.c @@ -5994,7 +5994,7 @@ wasm_interp_call_func_bytecode(WASMModuleInstance *module, || WASM_CPU_SUPPORTS_UNALIGNED_ADDR_ACCESS == 0 \ || WASM_ENABLE_BULK_MEMORY != 0 if (memory) - linear_mem_size = get_linear_mem_size(); + linear_mem_size = GET_LINEAR_MEMORY_SIZE(memory); #endif if (wasm_copy_exception(module, NULL)) goto got_exception;