Use CFG to recognize suspension point's end
Previously it was linear scan, failing on unbalanced suspension markers. Now, I use CFG to find end markers, which are reachable from start markers. Using CFG allows to walk through suspension point instructions only, since they form region. If, for some reason, end marker does not exist (inliner or unreachable code elimination pass remove unreachable code) or is unreachable, just ignore the whole suspension point, as before. #KT-33172 Fixed #KT-28507 Fixed
This commit is contained in:
+10
@@ -4040,6 +4040,16 @@ public class BlackBoxInlineCodegenTestGenerated extends AbstractBlackBoxInlineCo
|
||||
public void testPassParameter_1_3() throws Exception {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/stateMachine/passParameter.kt", "kotlin.coroutines");
|
||||
}
|
||||
|
||||
@TestMetadata("unreachableSuspendMarker.kt")
|
||||
public void testUnreachableSuspendMarker_1_2() throws Exception {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/stateMachine/unreachableSuspendMarker.kt", "kotlin.coroutines.experimental");
|
||||
}
|
||||
|
||||
@TestMetadata("unreachableSuspendMarker.kt")
|
||||
public void testUnreachableSuspendMarker_1_3() throws Exception {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/stateMachine/unreachableSuspendMarker.kt", "kotlin.coroutines");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user