Make code generation in method transformer more stable
Do not mix references to label nodes and common ASM labels as it may lead to different LabelNode instance (not defaultLabel) being inserted into insns list It's been working before because there was no `resetLabels` call on insnList, and label/label nodes were bound to each other
This commit is contained in:
+1
-1
@@ -125,9 +125,9 @@ class CoroutineTransformerMethodVisitor(
|
||||
)
|
||||
|
||||
insert(startLabel, withInstructionAdapter { generateResumeWithExceptionCheck(exceptionIndex) })
|
||||
insert(last, defaultLabel)
|
||||
|
||||
insert(last, withInstructionAdapter {
|
||||
visitLabel(defaultLabel.label)
|
||||
AsmUtil.genThrow(this, "java/lang/IllegalStateException", "call to 'resume' before 'invoke' with coroutine")
|
||||
areturn(Type.VOID_TYPE)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user