From 376660e8caf3ae2f7efe9e41c69ff71b049fabbd Mon Sep 17 00:00:00 2001 From: Mumfrey Date: Mon, 16 Jan 2017 14:59:55 +0000 Subject: [PATCH] Fix off-by-one error with static accessor injector --- .../asm/mixin/gen/AccessorGeneratorMethodProxy.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/spongepowered/asm/mixin/gen/AccessorGeneratorMethodProxy.java b/src/main/java/org/spongepowered/asm/mixin/gen/AccessorGeneratorMethodProxy.java index d5c985e3..3a322344 100644 --- a/src/main/java/org/spongepowered/asm/mixin/gen/AccessorGeneratorMethodProxy.java +++ b/src/main/java/org/spongepowered/asm/mixin/gen/AccessorGeneratorMethodProxy.java @@ -72,7 +72,7 @@ public class AccessorGeneratorMethodProxy extends AccessorGenerator { if (this.isInstanceMethod) { method.instructions.add(new VarInsnNode(Opcodes.ALOAD, 0)); } - ASMHelper.loadArgs(this.argTypes, method.instructions, 1); + ASMHelper.loadArgs(this.argTypes, method.instructions, this.isInstanceMethod ? 1 : 0); boolean isPrivate = ASMHelper.hasFlag(this.targetMethod, Opcodes.ACC_PRIVATE); int opcode = this.isInstanceMethod ? (isPrivate ? Opcodes.INVOKESPECIAL : Opcodes.INVOKEVIRTUAL) : Opcodes.INVOKESTATIC; method.instructions.add(new MethodInsnNode(opcode, this.info.getClassNode().name, this.targetMethod.name, this.targetMethod.desc, false));