Fix method inlining problems in 191 branch related to asm upgrade to 7.0

'visitAnnotableParameterCount' is propagating copying node state to
    destination one that corrupts its state
This commit is contained in:
Mikhael Bogdanov
2018-10-24 15:47:24 +02:00
parent bf39e1d146
commit e326b8755f
2 changed files with 21 additions and 1 deletions
@@ -0,0 +1,20 @@
/*
* Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
* that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.codegen.inline;
import org.jetbrains.org.objectweb.asm.MethodVisitor;
import org.jetbrains.org.objectweb.asm.commons.InstructionAdapter;
public class InlineMethodInstructionAdapter extends InstructionAdapter {
InlineMethodInstructionAdapter(MethodVisitor methodVisitor) {
super(InlineCodegenUtilsKt.API, methodVisitor);
}
public void visitAnnotableParameterCount(int parameterCount, boolean visible) {
}
}
@@ -405,7 +405,7 @@ class MethodInliner(
node.signature, node.exceptions?.toTypedArray()
)
val transformationVisitor = object : MethodVisitor(API, transformedNode) {
val transformationVisitor = object : InlineMethodInstructionAdapter(transformedNode) {
private val GENERATE_DEBUG_INFO = GENERATE_SMAP && inlineOnlySmapSkipper == null
private val isInliningLambda = nodeRemapper.isInsideInliningLambda