Skip to content

Commit f4c69e1

Browse files
committed
[embedded] Also allow nil in swift_isEscapingClosureAtFileLocation to match the C++ runtime
1 parent 4da6812 commit f4c69e1

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

stdlib/public/core/EmbeddedRuntime.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,9 @@ public func swift_dynamicCastClassUnconditional(object: UnsafeMutableRawPointer,
279279

280280
@_cdecl("swift_isEscapingClosureAtFileLocation")
281281
public func swift_isEscapingClosureAtFileLocation(object: Builtin.RawPointer, filename: UnsafePointer<CChar>, filenameLength: Int32, line: Int32, column: Int32, verificationType: CUnsignedInt) -> Bool {
282+
let objectBits = UInt(Builtin.ptrtoint_Word(object))
283+
if objectBits == 0 { return false }
284+
282285
guard swift_isUniquelyReferenced_native(object: object) else {
283286
fatalError("non-escaping closure escaped")
284287
}

0 commit comments

Comments
 (0)