Do not strip checkcasts for local 0 in static methods, fixes #471

This commit is contained in:
Mumfrey committed 2021-04-20 19:15:36 +01:00
1 parent 09b23eae8c
commit 5f51f16bb5
1 file changed
+2 -1
@@ -666,7 +666,8 @@ public class MixinTargetContext extends ClassContext implements IMixinContext {
if (typeInsn.getOpcode() == Opcodes.CHECKCAST
&& typeInsn.desc.equals(this.getTarget().getClassRef())
&& lastNode.getOpcode() == Opcodes.ALOAD
&& ((VarInsnNode)lastNode).var == 0) {
&& ((VarInsnNode)lastNode).var == 0
&& !Bytecode.isStatic(method)) {
iter.remove();
return;
}