Normalize local returns before other inlining transformations

Local returns normalization can generate POP instructions.
These POP instructions can drop functional parameters, as in KT-17590,
and should be processed in markPlacesForInlineAndRemoveInlinable just
as other POP instructions.

KT-17590 conditional return in inline function parameter argument causes compilation exception
This commit is contained in:
Dmitry Petrov
2017-04-25 16:43:21 +03:00
parent 996a08a3f7
commit fe571a7dfa
7 changed files with 113 additions and 43 deletions
@@ -4364,6 +4364,18 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
doTest(fileName);
}
@TestMetadata("kt17590.kt")
public void testKt17590() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/controlStructures/kt17590.kt");
doTest(fileName);
}
@TestMetadata("kt17590_long.kt")
public void testKt17590_long() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/controlStructures/kt17590_long.kt");
doTest(fileName);
}
@TestMetadata("kt1899.kt")
public void testKt1899() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/controlStructures/kt1899.kt");
@@ -4364,6 +4364,18 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
doTest(fileName);
}
@TestMetadata("kt17590.kt")
public void testKt17590() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/controlStructures/kt17590.kt");
doTest(fileName);
}
@TestMetadata("kt17590_long.kt")
public void testKt17590_long() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/controlStructures/kt17590_long.kt");
doTest(fileName);
}
@TestMetadata("kt1899.kt")
public void testKt1899() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/controlStructures/kt1899.kt");