[java-decompiler] initConstant: fix getField/putField handling

GitOrigin-RevId: b741b6e3faf5d800ca2b607439b6a459bcb2bf6a
master
Tagir Valeev 4 years ago committed by intellij-monorepo-bot
parent 44ae885a96
commit 0749965bc9
  1. 5
      src/org/jetbrains/java/decompiler/struct/consts/LinkConstant.java

@ -26,10 +26,11 @@ public class LinkConstant extends PooledConstant {
if (type == CONSTANT_Methodref || if (type == CONSTANT_Methodref ||
type == CONSTANT_InterfaceMethodref || type == CONSTANT_InterfaceMethodref ||
type == CONSTANT_InvokeDynamic || type == CONSTANT_InvokeDynamic ||
type == CONSTANT_MethodHandle) { (type == CONSTANT_MethodHandle && index1 != CONSTANT_MethodHandle_REF_getField && index1 != CONSTANT_MethodHandle_REF_putField)) {
int parenth = descriptor.indexOf(')'); int parenth = descriptor.indexOf(')');
if (descriptor.length() < 2 || parenth < 0 || descriptor.charAt(0) != '(') { if (descriptor.length() < 2 || parenth < 0 || descriptor.charAt(0) != '(') {
throw new IllegalArgumentException("Invalid descriptor: " + descriptor); throw new IllegalArgumentException("Invalid descriptor: " + descriptor +
"; type = " + type + "; classname = " + classname + "; elementname = " + elementname);
} }
} }
} }

Loading…
Cancel
Save