[K/N] Fix ObjC bridges LeaveFrame generation (return values in bridges are produced before epilogue block)
This commit is contained in:
+5
-4
@@ -475,7 +475,10 @@ internal abstract class FunctionGenerationContext(
|
|||||||
private val entryBb = basicBlockInFunction("entry", startLocation)
|
private val entryBb = basicBlockInFunction("entry", startLocation)
|
||||||
protected val cleanupLandingpad = basicBlockInFunction("cleanup_landingpad", endLocation)
|
protected val cleanupLandingpad = basicBlockInFunction("cleanup_landingpad", endLocation)
|
||||||
|
|
||||||
private var needLeaveFrameInUnwindEpilogue: Boolean = false
|
private val needLeaveFrameInUnwindEpilogue: Boolean
|
||||||
|
get() = irFunction?.annotations?.hasAnnotation(RuntimeNames.exportForCppRuntime) == true
|
||||||
|
|| forwardingForeignExceptionsTerminatedWith != null
|
||||||
|
|| irFunction?.origin == CBridgeOrigin.C_TO_KOTLIN_BRIDGE
|
||||||
private var setCurrentFrameIsCalled: Boolean = false
|
private var setCurrentFrameIsCalled: Boolean = false
|
||||||
|
|
||||||
val stackLocalsManager = StackLocalsManagerImpl(this, stackLocalsInitBb)
|
val stackLocalsManager = StackLocalsManagerImpl(this, stackLocalsInitBb)
|
||||||
@@ -1419,9 +1422,7 @@ internal abstract class FunctionGenerationContext(
|
|||||||
}
|
}
|
||||||
|
|
||||||
internal fun epilogue() {
|
internal fun epilogue() {
|
||||||
needLeaveFrameInUnwindEpilogue = irFunction?.annotations?.hasAnnotation(RuntimeNames.exportForCppRuntime) == true
|
val needLeaveFrameInUnwindEpilogue = this.needLeaveFrameInUnwindEpilogue
|
||||||
|| forwardingForeignExceptionsTerminatedWith != null
|
|
||||||
|| irFunction?.origin == CBridgeOrigin.C_TO_KOTLIN_BRIDGE
|
|
||||||
|
|
||||||
appendingTo(prologueBb) {
|
appendingTo(prologueBb) {
|
||||||
val slots = if (needSlotsPhi || needLeaveFrameInUnwindEpilogue)
|
val slots = if (needSlotsPhi || needLeaveFrameInUnwindEpilogue)
|
||||||
|
|||||||
Reference in New Issue
Block a user