From e4c32681b9349c8c4e7a69668d53903f295bc429 Mon Sep 17 00:00:00 2001 From: lax1dude Date: Sat, 30 Nov 2024 09:53:59 -0800 Subject: [PATCH] wasm gc: fix wrong argument order in System.arraycopy implementation (#975) --- .../wasm/generate/gc/classes/WasmGCClassGenerator.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/org/teavm/backend/wasm/generate/gc/classes/WasmGCClassGenerator.java b/core/src/main/java/org/teavm/backend/wasm/generate/gc/classes/WasmGCClassGenerator.java index edb6fd287..21389b9f7 100644 --- a/core/src/main/java/org/teavm/backend/wasm/generate/gc/classes/WasmGCClassGenerator.java +++ b/core/src/main/java/org/teavm/backend/wasm/generate/gc/classes/WasmGCClassGenerator.java @@ -876,8 +876,8 @@ public class WasmGCClassGenerator implements WasmGCClassInfoProvider, WasmGCInit var targetArrayData = new WasmStructGet(arrayStruct, targetArray, ARRAY_DATA_FIELD_OFFSET); function.getBody().add(new WasmArrayCopy( - arrayDataType, targetArrayData, new WasmGetLocal(sourceIndexLocal), - arrayDataType, sourceArrayData, new WasmGetLocal(targetIndexLocal), + arrayDataType, targetArrayData, new WasmGetLocal(targetIndexLocal), + arrayDataType, sourceArrayData, new WasmGetLocal(sourceIndexLocal), new WasmGetLocal(countLocal))); return function; }