diff --git a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/llvm/IrToBitcode.kt b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/llvm/IrToBitcode.kt index 85728355451..8644fcd034f 100644 --- a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/llvm/IrToBitcode.kt +++ b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/llvm/IrToBitcode.kt @@ -1442,13 +1442,14 @@ internal class CodeGeneratorVisitor(val context: Context) : IrElementVisitorVoid } } - if (!codegen.isAfterTerminator()) { // TODO should we solve this problem once and for all - if (inlinedFunctionScope.resultPhi != null) { - codegen.unreachable() - } - } - if (inlinedFunctionScope.bbExit != null) { + if (!codegen.isAfterTerminator()) { // TODO should we solve this problem once and for all + if (inlinedFunctionScope.resultPhi != null) { + codegen.unreachable() + } else { + codegen.br(inlinedFunctionScope.bbExit!!) + } + } codegen.positionAtEnd(inlinedFunctionScope.bbExit!!) }