diff --git a/plugins/jvm-abi-gen/src/org/jetbrains/kotlin/jvm/abi/asm/ReplaceWithEmptyMethodVisitor.kt b/plugins/jvm-abi-gen/src/org/jetbrains/kotlin/jvm/abi/asm/ReplaceWithEmptyMethodVisitor.kt index 6f7e7f0e68e..a848e1da743 100644 --- a/plugins/jvm-abi-gen/src/org/jetbrains/kotlin/jvm/abi/asm/ReplaceWithEmptyMethodVisitor.kt +++ b/plugins/jvm-abi-gen/src/org/jetbrains/kotlin/jvm/abi/asm/ReplaceWithEmptyMethodVisitor.kt @@ -19,5 +19,7 @@ internal class ReplaceWithEmptyMethodVisitor( ) : TransformationMethodVisitor(delegate, access, name, desc, signature, exceptions, api = ABI_EXTENSION_ASM_API_VERSION) { override fun performTransformations(methodNode: MethodNode) { methodNode.instructions.clear() + methodNode.localVariables.clear() + methodNode.tryCatchBlocks.clear() } } \ No newline at end of file diff --git a/plugins/jvm-abi-gen/testData/compare/functionBody/base/function.kt b/plugins/jvm-abi-gen/testData/compare/functionBody/base/function.kt index fe4bce1841c..46c201a8e7e 100644 --- a/plugins/jvm-abi-gen/testData/compare/functionBody/base/function.kt +++ b/plugins/jvm-abi-gen/testData/compare/functionBody/base/function.kt @@ -1,3 +1,10 @@ package test -fun sum(x: Int, y: Int): Int = x + y \ No newline at end of file +fun sum(x: Int, y: Int): Int = + try { + var result = x + result += y + result + } finally { + // do nothing + } \ No newline at end of file