Make start label of LVT record the point where variable becomes alive
Otherwise, there will be overlapping LVT records, which leads to removal of the whole LVT by R8. #KT-44714 Fixed
This commit is contained in:
+1
-2
@@ -1252,8 +1252,7 @@ private fun updateLvtAccordingToLiveness(method: MethodNode, isForNamedFunction:
|
||||
for (insnIndex in 0 until (method.instructions.size() - 1)) {
|
||||
val insn = method.instructions[insnIndex]
|
||||
if (!isAlive(insnIndex, variableIndex) && isAlive(insnIndex + 1, variableIndex)) {
|
||||
val lvtRecord = oldLvt.findRecord(insnIndex, variableIndex) ?: continue
|
||||
startLabel = max(lvtRecord.start, previousSuspensionPointLabel(insn))
|
||||
startLabel = insn as? LabelNode ?: insn.findNextOrNull { it is LabelNode } as? LabelNode
|
||||
}
|
||||
if (isAlive(insnIndex, variableIndex) && !isAlive(insnIndex + 1, variableIndex)) {
|
||||
// No variable in LVT -> do not add one
|
||||
|
||||
+1
-1
@@ -15,7 +15,7 @@ fun main(args: Array<String>) {
|
||||
suspend fun SequenceScope<Int>.awaitSeq(): Int = 42
|
||||
|
||||
|
||||
// 1 LOCALVARIABLE a I L[0-9]+ L4
|
||||
// 1 LOCALVARIABLE a I L[0-9]+ L19
|
||||
|
||||
/* TODO: JVM_IR does not generate LINENUMBER at the end of the lambda */
|
||||
// JVM_TEMPLATES
|
||||
|
||||
Reference in New Issue
Block a user