Do not restore stack in default handler for try-finally

It never terminates, so the corresponding value on stack can't be used.
However, if this happens in an inlined lambda argument, the inliner is
unable to remove the corresponding ALOAD instruction (because default
handler never terminates, and thus corresponding ALOAD is not used for
lambda invocation).

KT-17573 try-finally expression in inlined function parameter argument fails with VerifyError
This commit is contained in:
Dmitry Petrov
2017-04-25 12:25:32 +03:00
parent e91f4cf65a
commit e1731373d8
8 changed files with 83 additions and 4 deletions
@@ -4810,6 +4810,18 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
doTest(fileName);
}
@TestMetadata("kt17573.kt")
public void testKt17573() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/controlStructures/tryCatchInExpressions/kt17573.kt");
doTest(fileName);
}
@TestMetadata("kt17573_nested.kt")
public void testKt17573_nested() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/controlStructures/tryCatchInExpressions/kt17573_nested.kt");
doTest(fileName);
}
@TestMetadata("kt8608.kt")
public void testKt8608() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/controlStructures/tryCatchInExpressions/kt8608.kt");
@@ -4810,6 +4810,18 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
doTest(fileName);
}
@TestMetadata("kt17573.kt")
public void testKt17573() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/controlStructures/tryCatchInExpressions/kt17573.kt");
doTest(fileName);
}
@TestMetadata("kt17573_nested.kt")
public void testKt17573_nested() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/controlStructures/tryCatchInExpressions/kt17573_nested.kt");
doTest(fileName);
}
@TestMetadata("kt8608.kt")
public void testKt8608() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/controlStructures/tryCatchInExpressions/kt8608.kt");