From ba54f82dc0e844ce307027252ff7139cb7cde7d5 Mon Sep 17 00:00:00 2001 From: Alexey Andreev Date: Sun, 29 Nov 2015 10:45:29 +0300 Subject: [PATCH] Fix parsing InvokeDynamic method handle --- core/src/main/java/org/teavm/model/MethodHandle.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/org/teavm/model/MethodHandle.java b/core/src/main/java/org/teavm/model/MethodHandle.java index f311497ba..4c5859042 100644 --- a/core/src/main/java/org/teavm/model/MethodHandle.java +++ b/core/src/main/java/org/teavm/model/MethodHandle.java @@ -103,8 +103,8 @@ public class MethodHandle { } public static MethodHandle virtualCaller(String className, String name, ValueType... arguments) { - ValueType valueType = arguments[0]; - arguments = Arrays.copyOfRange(arguments, 1, arguments.length); + ValueType valueType = arguments[arguments.length - 1]; + arguments = Arrays.copyOfRange(arguments, 0, arguments.length - 1); return new MethodHandle(MethodHandleType.INVOKE_VIRTUAL, className, name, valueType, arguments); }