[KT-32929] Filter exceptions from objc alloc (#3318)
Issue: SIGSEGV in Throwable.printStackTrace when terminating after ObjC alloc exception Root-cause: Corrupted kotlin.Throwable has been sent as ReportUnhandledException() parameter Fix: Use @FilterException which terminates correctly with objc_terminate
This commit is contained in:
@@ -22,6 +22,7 @@ import kotlin.native.internal.ExportTypeInfo
|
||||
import kotlin.native.internal.ExportForCppRuntime
|
||||
import kotlin.native.internal.TypedIntrinsic
|
||||
import kotlin.native.internal.IntrinsicType
|
||||
import kotlin.native.internal.FilterExceptions
|
||||
|
||||
interface ObjCObject
|
||||
interface ObjCClass : ObjCObject
|
||||
@@ -207,6 +208,7 @@ external fun objc_autoreleasePoolPush(): NativePtr
|
||||
external fun objc_autoreleasePoolPop(ptr: NativePtr)
|
||||
|
||||
@SymbolName("Kotlin_objc_allocWithZone")
|
||||
@FilterExceptions
|
||||
private external fun objc_allocWithZone(clazz: NativePtr): NativePtr
|
||||
|
||||
@SymbolName("Kotlin_objc_retain")
|
||||
|
||||
Reference in New Issue
Block a user