[JVM] Split the variable range for external finally blocks in inliner

When external finally blocks are inlined none of the current locals
are in scope of the finally block.
This commit is contained in:
Mads Ager
2021-04-13 15:39:00 +02:00
committed by Mikhael Bogdanov
parent 6d9f02cfc6
commit 6095d8a7fa
10 changed files with 381 additions and 30 deletions
@@ -320,8 +320,7 @@ abstract class InlineCodegen<out T : BaseExpressionCodegen>(
val splitBy = SimpleInterval(start.info as LabelNode, extension.finallyIntervalEnd)
processor.tryBlocksMetaInfo.splitAndRemoveCurrentIntervals(splitBy, true)
//processor.getLocalVarsMetaInfo().splitAndRemoveIntervalsFromCurrents(splitBy);
processor.localVarsMetaInfo.splitAndRemoveCurrentIntervals(splitBy, true);
mark.dropTo()
}
@@ -330,8 +329,7 @@ abstract class InlineCodegen<out T : BaseExpressionCodegen>(
}
processor.substituteTryBlockNodes(intoNode)
//processor.substituteLocalVarTable(intoNode);
processor.substituteLocalVarTable(intoNode);
}
protected abstract fun generateAssertFieldIfNeeded(info: RootInliningContext)