Spill stack before analyzing it when looking for non-inline suspend lambda

parameters of inline function. Otherwise, it leads to AnalyzerException,
when inlined lambda contains try-catch block. The reason is simple:
in try block, we leave some variables on stack, while on catch block the
stack is empty. Spilling the variables before try block does the trick.
 #KT-34708 Fixed
This commit is contained in:
Ilmir Usmanov
2020-02-05 16:08:17 +01:00
parent b7a6fc271c
commit 7dfd7b6081
9 changed files with 115 additions and 3 deletions
@@ -3813,6 +3813,16 @@ public class BlackBoxInlineCodegenTestGenerated extends AbstractBlackBoxInlineCo
runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/returnValue.kt", "kotlin.coroutines");
}
@TestMetadata("tryCatchReceiver.kt")
public void testTryCatchReceiver_1_2() throws Exception {
runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/tryCatchReceiver.kt", "kotlin.coroutines.experimental");
}
@TestMetadata("tryCatchReceiver.kt")
public void testTryCatchReceiver_1_3() throws Exception {
runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/tryCatchReceiver.kt", "kotlin.coroutines");
}
@TestMetadata("tryCatchStackTransform.kt")
public void testTryCatchStackTransform_1_2() throws Exception {
runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/tryCatchStackTransform.kt", "kotlin.coroutines.experimental");