Commit 5074bdc9 authored by Remi Forax's avatar Remi Forax
Browse files

fix CheckMethodAdapter to allow <init> as name when doing a LDC of a

method handle
parent f5270ecd
......@@ -1199,7 +1199,10 @@ public class CheckMethodAdapter extends MethodVisitor {
} else {
checkMethodDescriptor(this.version, handle.getDesc());
checkMethodIdentifier(this.version, handle.getName(), "handle name");
String handleName = handle.getName();
if (!("<init>".equals(handleName) && tag == Opcodes.H_NEWINVOKESPECIAL)) {
checkMethodIdentifier(this.version, handleName, "handle name");
} else if (value instanceof ConstantDynamic) {
if ((version & 0xFFFF) < Opcodes.V11) {
throw new IllegalArgumentException("ldc of a ConstantDynamic requires at least version 11");
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment