Merge pull request #611 from Spottedleaf/asm-fix

Fix #610
This commit is contained in:
Zach Brown 2017-02-14 16:00:13 -06:00
commit 429c24e8c9

View file

@ -147,7 +147,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ methodGenerator.checkCast(Type.getType(m.getDeclaringClass())); + methodGenerator.checkCast(Type.getType(m.getDeclaringClass()));
+ methodGenerator.loadArg(1); + methodGenerator.loadArg(1);
+ methodGenerator.checkCast(Type.getType(m.getParameterTypes()[0])); + 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) { + if (m.getReturnType() != void.class) {
+ methodGenerator.pop(); + methodGenerator.pop();
+ } + }