JVM: fix inline cycle detection
1. use the correct descriptor in the old backend; 2. clear the temporary variables for arguments in the IR backend. #KT-45292 Fixed
This commit is contained in:
@@ -108,11 +108,9 @@ abstract class InlineCodegen<out T : BaseExpressionCodegen>(
|
||||
)
|
||||
}
|
||||
|
||||
protected fun generateStub(resolvedCall: ResolvedCall<*>?, codegen: BaseExpressionCodegen) {
|
||||
protected fun generateStub(text: String, codegen: BaseExpressionCodegen) {
|
||||
leaveTemps()
|
||||
assert(resolvedCall != null)
|
||||
val message = "Call is part of inline cycle: " + resolvedCall!!.call.callElement.text
|
||||
AsmUtil.genThrow(codegen.v, "java/lang/UnsupportedOperationException", message)
|
||||
AsmUtil.genThrow(codegen.v, "java/lang/UnsupportedOperationException", "Call is part of inline cycle: $text")
|
||||
}
|
||||
|
||||
protected fun endCall(result: InlineResult, registerLineNumberAfterwards: Boolean) {
|
||||
|
||||
@@ -60,8 +60,8 @@ class PsiInlineCodegen(
|
||||
callDefault: Boolean,
|
||||
codegen: ExpressionCodegen
|
||||
) {
|
||||
if (!state.globalInlineContext.enterIntoInlining(resolvedCall?.resultingDescriptor, resolvedCall?.call?.callElement)) {
|
||||
generateStub(resolvedCall, codegen)
|
||||
if (!state.globalInlineContext.enterIntoInlining(functionDescriptor, resolvedCall?.call?.callElement)) {
|
||||
generateStub(resolvedCall?.call?.callElement?.text ?: "<no source>", codegen)
|
||||
return
|
||||
}
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user