[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:
Vladimir Ivanov
2019-09-13 14:50:23 +03:00
committed by GitHub
parent 4f0a3b7a13
commit 05ce6e1e84
3 changed files with 33 additions and 0 deletions
@@ -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")