Add NOP as first instruction in coroutine's try blocks
#KT-35035 Fixed
This commit is contained in:
+3
-1
@@ -783,13 +783,15 @@ class CoroutineTransformerMethodVisitor(
|
||||
// See 'splitTryCatchBlocksContainingSuspensionPoint'
|
||||
val possibleTryCatchBlockStart = suspension.tryCatchBlocksContinuationLabel
|
||||
|
||||
// Remove NOP as it's unnecessary anymore
|
||||
// Move NOP, which is inserted in `splitTryCatchBlocksContainingSuspentionPoint`, inside the try catch block,
|
||||
// so the inliner can transform suspend lambdas during inlining
|
||||
assert(possibleTryCatchBlockStart.previous.opcode == Opcodes.NOP) {
|
||||
"NOP expected but ${possibleTryCatchBlockStart.previous.opcode} was found"
|
||||
}
|
||||
remove(possibleTryCatchBlockStart.previous)
|
||||
|
||||
insert(possibleTryCatchBlockStart, withInstructionAdapter {
|
||||
nop()
|
||||
generateResumeWithExceptionCheck(languageVersionSettings.isReleaseCoroutines(), dataIndex, exceptionIndex)
|
||||
|
||||
// Load continuation argument just like suspending function returns it
|
||||
|
||||
Reference in New Issue
Block a user