JVM Inline: Update tryCatchBlocks when expand mask conditions
Fixes: KT-48989
This commit is contained in:
@@ -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
|
||||
|
||||
+6
@@ -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 {
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
// TARGET_BACKEND: JVM_IR
|
||||
fun box() = inlineFunctionWithDefaultArguments("OK")
|
||||
|
||||
inline fun inlineFunctionWithDefaultArguments(
|
||||
p0: String = try {
|
||||
"42"
|
||||
} finally {
|
||||
}, p1: Any = p0
|
||||
) = p1
|
||||
+6
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user