< prev index next >
src/java.base/share/classes/jdk/internal/org/objectweb/asm/util/CheckMethodAdapter.java
Print this page
rev 47452 : imported patch jdk-new-asmv6.patch
*** 424,434 ****
* @throws IllegalStateException
* If a subclass calls this constructor.
*/
public CheckMethodAdapter(final MethodVisitor mv,
final Map<Label, Integer> labels) {
! this(Opcodes.ASM5, mv, labels);
if (getClass() != CheckMethodAdapter.class) {
throw new IllegalStateException();
}
}
--- 424,434 ----
* @throws IllegalStateException
* If a subclass calls this constructor.
*/
public CheckMethodAdapter(final MethodVisitor mv,
final Map<Label, Integer> labels) {
! this(Opcodes.ASM6, mv, labels);
if (getClass() != CheckMethodAdapter.class) {
throw new IllegalStateException();
}
}
*** 437,447 ****
* will not perform any data flow check (see
* {@link #CheckMethodAdapter(int,String,String,MethodVisitor,Map)}).
*
* @param api
* the ASM API version implemented by this CheckMethodAdapter.
! * Must be one of {@link Opcodes#ASM4} or {@link Opcodes#ASM5}.
* @param mv
* the method visitor to which this adapter must delegate calls.
* @param labels
* a map of already visited labels (in other methods).
*/
--- 437,448 ----
* will not perform any data flow check (see
* {@link #CheckMethodAdapter(int,String,String,MethodVisitor,Map)}).
*
* @param api
* the ASM API version implemented by this CheckMethodAdapter.
! * 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
* a map of already visited labels (in other methods).
*/
*** 754,763 ****
--- 755,770 ----
}
if (opcode == Opcodes.INVOKEINTERFACE && !itf) {
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
// compatibility code, we inline the code of the overridden method here.
if (mv != null) {
< prev index next >