JVM_IR: Add more local variable tests for finally code.

This commit is contained in:
Mads Ager
2021-04-27 17:19:07 +02:00
committed by Mikhael Bogdanov
parent 6095d8a7fa
commit 0c77565104
10 changed files with 268 additions and 3 deletions
@@ -423,7 +423,7 @@ class ExpressionCodegen(
}
}
private fun addLocalVariableGapsForFinallyBlocks(
private fun splitLocalVariableRangesByFinallyBlocks(
info: BlockInfo,
tryWithFinallyInfo: TryWithFinallyInfo,
gapStart: Label,
@@ -1276,7 +1276,7 @@ class ExpressionCodegen(
// Split the local variables for the blocks on the way to the finally. Variables introduced in these blocks do not
// cover the finally block code.
val endOfFinallyCode = markNewLinkedLabel()
addLocalVariableGapsForFinallyBlocks(data, tryWithFinallyInfo, gapStart, endOfFinallyCode)
splitLocalVariableRangesByFinallyBlocks(data, tryWithFinallyInfo, gapStart, endOfFinallyCode)
val gapEnd = afterJumpLabel ?: endOfFinallyCode
tryWithFinallyInfo.gaps.add(gapStart to gapEnd)