From 19fa8bcffc9b544af9429237da2fda6039e6d06a Mon Sep 17 00:00:00 2001 From: Spottedleaf Date: Tue, 14 Feb 2017 03:04:20 -0800 Subject: [PATCH] Use invokeinterface for methods defined in interfaces in the ASM executor --- Spigot-API-Patches/Use-ASM-for-event-executors.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Spigot-API-Patches/Use-ASM-for-event-executors.patch b/Spigot-API-Patches/Use-ASM-for-event-executors.patch index 8264ee5cd7..7c12ff7127 100644 --- a/Spigot-API-Patches/Use-ASM-for-event-executors.patch +++ b/Spigot-API-Patches/Use-ASM-for-event-executors.patch @@ -147,7 +147,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + methodGenerator.checkCast(Type.getType(m.getDeclaringClass())); + methodGenerator.loadArg(1); + methodGenerator.checkCast(Type.getType(m.getParameterTypes()[0])); -+ methodGenerator.visitMethodInsn(INVOKEVIRTUAL, Type.getInternalName(m.getDeclaringClass()), m.getName(), Type.getMethodDescriptor(m), m.getDeclaringClass().isInterface()); ++ methodGenerator.visitMethodInsn(m.getDeclaringClass().isInterface() ? INVOKEINTERFACE : INVOKEVIRTUAL, Type.getInternalName(m.getDeclaringClass()), m.getName(), Type.getMethodDescriptor(m), m.getDeclaringClass().isInterface()); + if (m.getReturnType() != void.class) { + methodGenerator.pop(); + }