Debugger: Fix missing NOPs in optimized Unit.INSTANCE calls (KT-31702)

This commit is contained in:
Yan Zhulanow
2019-06-21 16:23:46 +09:00
parent f60bf5cb97
commit d45bbaabcd
4 changed files with 29 additions and 0 deletions
@@ -113,6 +113,7 @@ class RedundantLocalsEliminationMethodTransformer(private val languageVersionSet
val insns =
findPopPredecessors(methodNode) { it.isUnitInstance() || it.opcode == Opcodes.ACONST_NULL || it.opcode == Opcodes.ALOAD }
for ((pred, pop) in insns) {
methodNode.instructions.insertBefore(pred, InsnNode(Opcodes.NOP))
methodNode.instructions.removeAll(listOf(pred, pop))
}
return insns.isNotEmpty()