As catching exception by type requires RTTI, use catch all clause. (#136)
This commit is contained in:
+1
-2
@@ -858,8 +858,7 @@ internal class CodeGeneratorVisitor(val context: Context) : IrElementVisitorVoid
|
|||||||
val landingpadResult =
|
val landingpadResult =
|
||||||
LLVMBuildLandingPad(codegen.builder, landingpadType, personalityFunctionRaw, numClauses, "lp")
|
LLVMBuildLandingPad(codegen.builder, landingpadType, personalityFunctionRaw, numClauses, "lp")
|
||||||
|
|
||||||
// Configure landingpad to catch C++ exception with type `KotlinException`:
|
LLVMAddClause(landingpadResult, LLVMConstNull(kInt8Ptr))
|
||||||
LLVMAddClause(landingpadResult, externalGlobal("_ZTI15KotlinException", int8Type))
|
|
||||||
|
|
||||||
// FIXME: properly handle C++ exceptions: currently C++ exception can be thrown out from try-finally
|
// FIXME: properly handle C++ exceptions: currently C++ exception can be thrown out from try-finally
|
||||||
// bypassing the finally block.
|
// bypassing the finally block.
|
||||||
|
|||||||
Reference in New Issue
Block a user