Check that boxing instruction is simple call

like T.valueOf(unboxType(T))

 #KT-6047 fixed
This commit is contained in:
Denis Zharkov
2014-10-16 23:12:56 +04:00
committed by Alexander Udalov
parent 34269e1a3e
commit ec63394121
3 changed files with 30 additions and 2 deletions
@@ -144,9 +144,13 @@ public class BoxingInterpreter extends OptimizationBasicInterpreter {
private static boolean isBoxing(@NotNull AbstractInsnNode insn) {
if (insn.getOpcode() != Opcodes.INVOKESTATIC) return false;
MethodInsnNode methodInsnNode = (MethodInsnNode) insn;
MethodInsnNode node = (MethodInsnNode) insn;
return isWrapperClassName(methodInsnNode.owner) && "valueOf".equals(methodInsnNode.name);
return isWrapperClassName(node.owner) && "valueOf".equals(node.name) &&
Type.getMethodDescriptor(
Type.getObjectType(node.owner),
AsmUtil.unboxType(Type.getObjectType(node.owner))
).equals(node.desc);
}
private static boolean isNextMethodCallOfProgressionIterator(