--- old/src/java.base/share/classes/jdk/internal/org/objectweb/asm/util/CheckMethodAdapter.java Fri Oct 27 09:24:54 2017 +++ new/src/java.base/share/classes/jdk/internal/org/objectweb/asm/util/CheckMethodAdapter.java Fri Oct 27 09:24:53 2017 @@ -426,7 +426,7 @@ */ public CheckMethodAdapter(final MethodVisitor mv, final Map labels) { - this(Opcodes.ASM5, mv, labels); + this(Opcodes.ASM6, mv, labels); if (getClass() != CheckMethodAdapter.class) { throw new IllegalStateException(); } @@ -439,7 +439,8 @@ * * @param api * the ASM API version implemented by this CheckMethodAdapter. - * Must be one of {@link Opcodes#ASM4} or {@link Opcodes#ASM5}. + * Must be one of {@link Opcodes#ASM4}, {@link Opcodes#ASM5} + * or {@link Opcodes#ASM6}. * @param mv * the method visitor to which this adapter must delegate calls. * @param labels @@ -756,6 +757,12 @@ throw new IllegalArgumentException( "INVOKEINTERFACE can't be used with classes"); } + if (opcode == Opcodes.INVOKESPECIAL && itf + && (version & 0xFFFF) < Opcodes.V1_8) { + throw new IllegalArgumentException( + "INVOKESPECIAL can't be used with interfaces prior to Java 8"); + } + // Calling super.visitMethodInsn requires to call the correct version // depending on this.api (otherwise infinite loops can occur). To // simplify and to make it easier to automatically remove the backward