From 7cac0531adf7bd4327fa1854fe3481c7887c1799 Mon Sep 17 00:00:00 2001 From: Xu Jun Date: Wed, 7 Feb 2024 13:24:47 +0800 Subject: [PATCH] fast-interp: Fix copy_stack_top_i64 overlap issue (#3146) This fixes https://github.com/bytecodealliance/wasm-micro-runtime/issues/3145. --- core/iwasm/interpreter/wasm_interp_fast.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/iwasm/interpreter/wasm_interp_fast.c b/core/iwasm/interpreter/wasm_interp_fast.c index ca040d02..a7dcfd61 100644 --- a/core/iwasm/interpreter/wasm_interp_fast.c +++ b/core/iwasm/interpreter/wasm_interp_fast.c @@ -4794,8 +4794,9 @@ wasm_interp_call_func_bytecode(WASMModuleInstance *module, { addr1 = GET_OFFSET(); addr2 = GET_OFFSET(); - frame_lp[addr2] = frame_lp[addr1]; - frame_lp[addr2 + 1] = frame_lp[addr1 + 1]; + + PUT_I64_TO_ADDR(frame_lp + addr2, + GET_I64_FROM_ADDR(frame_lp + addr1)); #if WASM_ENABLE_GC != 0 /* Ignore constants because they are not reference */