Skip to content

Commit 2b415a3

Browse files
committed
[StdlibUnittest] Avoid serializing references to ObjC runtime APIs.
Specifically, objc_setUncaughtExceptionHandler, whose nullability is now annotated in Swift 4 mode when using the Xcode 9 SDKs. That means it has a different signature in Swift 3 and Swift 4 mode, which means that references from SIL will fail when deserialized in the other mode. (The recovery support added in earlier commits doesn't cover serialized SIL.) This resulted in crashes when building with -build-serialized-stdlib-unittest, which enables -sil-serialize-all / "magic performance mode" when building the StdlibUnittest module like it does the standard libarry. None of this affects developer code, because developer code doesn't serialize anything (if they're playing by the rules).
1 parent cc11e8b commit 2b415a3

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

stdlib/private/StdlibUnittest/StdlibUnittest.swift.gyb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -624,6 +624,8 @@ func _stdlib_installTrapInterceptor()
624624
}
625625
#endif
626626

627+
// Avoid serializing references to objc_setUncaughtExceptionHandler in SIL.
628+
@inline(never) @_semantics("stdlib_binary_only")
627629
func _childProcess() {
628630
_stdlib_installTrapInterceptor()
629631

0 commit comments

Comments
 (0)