JVM Inline: Update tryCatchBlocks when expand mask conditions

Fixes: KT-48989
This commit is contained in:
Xin Wang
2022-11-03 10:44:25 +08:00
committed by teamcity
parent 44ea1debf4
commit 7278f9a4fd
4 changed files with 25 additions and 0 deletions
@@ -112,6 +112,10 @@ fun expandMaskConditionsAndUpdateVariableNodes(
(it.start in toDelete && it.end in toDelete) || validOffsets.contains(it.index)
}
node.tryCatchBlocks.removeIf {
toDelete.contains(it.start) && toDelete.contains(it.end)
}
node.remove(toDelete)
return defaultLambdasInfo
@@ -18937,6 +18937,12 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT
runTest("compiler/testData/codegen/box/functions/kt48058.kt");
}
@Test
@TestMetadata("kt48989.kt")
public void testKt48989() throws Exception {
runTest("compiler/testData/codegen/box/functions/kt48989.kt");
}
@Test
@TestMetadata("kt785.kt")
public void testKt785() throws Exception {
+9
View File
@@ -0,0 +1,9 @@
// TARGET_BACKEND: JVM_IR
fun box() = inlineFunctionWithDefaultArguments("OK")
inline fun inlineFunctionWithDefaultArguments(
p0: String = try {
"42"
} finally {
}, p1: Any = p0
) = p1
@@ -18937,6 +18937,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
runTest("compiler/testData/codegen/box/functions/kt48058.kt");
}
@Test
@TestMetadata("kt48989.kt")
public void testKt48989() throws Exception {
runTest("compiler/testData/codegen/box/functions/kt48989.kt");
}
@Test
@TestMetadata("kt785.kt")
public void testKt785() throws Exception {