Final proper callback fix

This commit is contained in:
Clisprail
2014-04-11 01:55:50 +02:00
parent 45957c8d34
commit a2dafd9e41
@@ -1,5 +1,7 @@
package org.parabot.core.asm.adapters; package org.parabot.core.asm.adapters;
import java.lang.reflect.Modifier;
import org.objectweb.asm.Label; import org.objectweb.asm.Label;
import org.objectweb.asm.Opcodes; import org.objectweb.asm.Opcodes;
import org.objectweb.asm.Type; import org.objectweb.asm.Type;
@@ -43,7 +45,7 @@ public class AddCallbackAdapter implements Injectable, Opcodes {
inject.add(new LabelNode(l0)); inject.add(new LabelNode(l0));
for (int arg : args) { for (int arg : args) {
inject.add(new VarInsnNode(ASMUtils.getLoadOpcode(types[arg] inject.add(new VarInsnNode(ASMUtils.getLoadOpcode(types[arg]
.getDescriptor()), arg)); .getDescriptor()), Modifier.isStatic(method.access) ? arg : arg + 1));
} }
inject.add(new MethodInsnNode(INVOKESTATIC, inject.add(new MethodInsnNode(INVOKESTATIC,
this.invokeClass, this.invokeMethod, this.invokeClass, this.invokeMethod,