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

GitOrigin-RevId: b741b6e3faf5d800ca2b607439b6a459bcb2bf6a
This commit is contained in:
Tagir Valeev
2020-07-29 13:15:14 +07:00
committed by intellij-monorepo-bot
parent c7e1b06147
commit 30ac420fb3

View File

@@ -26,10 +26,11 @@ public class LinkConstant extends PooledConstant {
if (type == CONSTANT_Methodref ||
type == CONSTANT_InterfaceMethodref ||
type == CONSTANT_InvokeDynamic ||
type == CONSTANT_MethodHandle) {
(type == CONSTANT_MethodHandle && index1 != CONSTANT_MethodHandle_REF_getField && index1 != CONSTANT_MethodHandle_REF_putField)) {
int parenth = descriptor.indexOf(')');
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);
}
}
}