Do not duplicate $result in LVT

#KT-47749
This commit is contained in:
Ilmir Usmanov
2021-07-18 20:37:08 +02:00
committed by Space
parent b4d356c5bd
commit 5ae01c8b2a
2 changed files with 2 additions and 2 deletions
@@ -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
@@ -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 <init>
// 4 LOCALVARIABLE this LA;