Fix compilation against asm 7.0

This commit is contained in:
Mikhael Bogdanov
2021-02-01 16:47:09 +01:00
parent 78c6e0733c
commit 206b38f0ab
@@ -84,7 +84,7 @@ class CapturedVarsOptimizationMethodTransformer : MethodTransformer() {
private fun AbstractInsnNode.getIndex() = methodNode.instructions.indexOf(this)
private fun createRefValues() {
for (insn in methodNode.instructions) {
for (insn in methodNode.instructions.asSequence()) {
if (insn.opcode == Opcodes.NEW && insn is TypeInsnNode) {
val type = Type.getObjectType(insn.desc)
if (AsmTypes.isSharedVarType(type)) {
@@ -124,7 +124,7 @@ class CapturedVarsOptimizationMethodTransformer : MethodTransformer() {
}
private fun trackPops(frames: Array<out Frame<BasicValue>?>) {
for ((i, insn) in methodNode.instructions.withIndex()) {
for ((i, insn) in methodNode.instructions.asSequence().withIndex()) {
val frame = frames[i] ?: continue
when (insn.opcode) {
Opcodes.POP -> {