From 8071b4999faa5f0031653f32e521803d141cab73 Mon Sep 17 00:00:00 2001 From: Nikolay Igotti Date: Mon, 12 Dec 2016 18:13:31 +0300 Subject: [PATCH] As catching exception by type requires RTTI, use catch all clause. (#136) --- .../src/org/jetbrains/kotlin/backend/konan/llvm/IrToBitcode.kt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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 1070c000026..b0e3418d76b 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 @@ -858,8 +858,7 @@ internal class CodeGeneratorVisitor(val context: Context) : IrElementVisitorVoid val landingpadResult = LLVMBuildLandingPad(codegen.builder, landingpadType, personalityFunctionRaw, numClauses, "lp") - // Configure landingpad to catch C++ exception with type `KotlinException`: - LLVMAddClause(landingpadResult, externalGlobal("_ZTI15KotlinException", int8Type)) + LLVMAddClause(landingpadResult, LLVMConstNull(kInt8Ptr)) // FIXME: properly handle C++ exceptions: currently C++ exception can be thrown out from try-finally // bypassing the finally block.