diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/coroutines/CoroutineTransformerMethodVisitor.kt b/compiler/backend/src/org/jetbrains/kotlin/codegen/coroutines/CoroutineTransformerMethodVisitor.kt index 246550708eb..4ec1d3aea8f 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/coroutines/CoroutineTransformerMethodVisitor.kt +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/coroutines/CoroutineTransformerMethodVisitor.kt @@ -1315,7 +1315,7 @@ private fun updateLvtAccordingToLiveness(method: MethodNode, isForNamedFunction: if (isAlive(insnIndex, variableIndex) && !isAlive(insnIndex + 1, variableIndex)) { // No variable in LVT -> do not add one val lvtRecord = oldLvt.findRecord(insnIndex, variableIndex) ?: continue - if (lvtRecord.name == CONTINUATION_VARIABLE_NAME) continue + if (lvtRecord.name == CONTINUATION_VARIABLE_NAME || lvtRecord.name == SUSPEND_CALL_RESULT_NAME) continue // End the local when it is no longer live. Since it is not live, we will not spill and unspill it across // suspension points. It is tempting to keep it alive until the next suspension point to leave it visible in // the debugger for as long as possible. However, in the case of loops, the resumption after suspension can diff --git a/compiler/testData/codegen/bytecodeText/coroutines/debug/thisAndResultInLvt.kt b/compiler/testData/codegen/bytecodeText/coroutines/debug/thisAndResultInLvt.kt index 967f79eda03..8d82b4840f7 100644 --- a/compiler/testData/codegen/bytecodeText/coroutines/debug/thisAndResultInLvt.kt +++ b/compiler/testData/codegen/bytecodeText/coroutines/debug/thisAndResultInLvt.kt @@ -21,7 +21,7 @@ class A { // BEs generate continuation classes differently, JVM_IR generates more correctly // foo, c's lambda and foo's continuation -// 8 LOCALVARIABLE \$result Ljava/lang/Object; +// 3 LOCALVARIABLE \$result Ljava/lang/Object; // foo x 3 since we split the local over restore code for the two calls to block(), and // 4 LOCALVARIABLE this LA;