From f6131a82481a6da51c900e1b30a680fabbede13c Mon Sep 17 00:00:00 2001 From: Alexey Andreev Date: Tue, 22 Aug 2023 17:11:04 +0200 Subject: [PATCH] wasm: fix Array.get with enabled inlining --- .../org/teavm/backend/wasm/generators/ArrayGenerator.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/org/teavm/backend/wasm/generators/ArrayGenerator.java b/core/src/main/java/org/teavm/backend/wasm/generators/ArrayGenerator.java index ca5b4ac7f..cc32febf5 100644 --- a/core/src/main/java/org/teavm/backend/wasm/generators/ArrayGenerator.java +++ b/core/src/main/java/org/teavm/backend/wasm/generators/ArrayGenerator.java @@ -109,7 +109,11 @@ public class ArrayGenerator implements WasmMethodGenerator { MethodReference methodRef = new MethodReference(wrapper, "valueOf", primitiveTypes[i], ValueType.object(wrapper)); ClassReader cls = context.getClassSource().get(methodRef.getClassName()); - if (cls == null || cls.getMethod(methodRef.getDescriptor()) == null) { + if (cls == null) { + continue; + } + var valueOfMethod = cls.getMethod(methodRef.getDescriptor()); + if (valueOfMethod == null || valueOfMethod.getProgram() == null) { continue; }