Files
swift-mirror/stdlib/runtime/SwiftObject.mm
Joe Groff 7191b87759 Runtime: Don't touch potentially ObjC unowned-referenced objects to determine their species.
ObjC unowned references are backed by an ObjC weak reference which will eagerly deallocate the object when it's strongly released, so in an unknown-refcount situation, we can't safely dereference the object pointer to determine its Swiftness. We can, however, look at the side table of weak references; if there's an entry for this object, then it's reliably an ObjC object (or it's some other object that got allocated in the reclaimed space for the dead object, but that's a race we fundamentally can't win with this broken design). Fixes rdar://problem/18091547 (modulo the aforementioned reallocation race).

Swift SVN r24825
2015-01-29 22:49:45 +00:00

35 KiB