Skip to content

Commit 4289953

Browse files
committed
[Runtime] Fix swift_bridgeObjectRetain on ARM64 Linux.
The tail call of swift_retain isn't correct there. Revert back to a non-tail call for all !SWIFT_OBJC_INTEROP for now. rdar://102152616
1 parent c4ebdeb commit 4289953

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

stdlib/public/runtime/SwiftObject.mm

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -609,7 +609,10 @@ static bool isBridgeObjectTaggedPointer(void *object) {
609609
// bit set.
610610
SWIFT_MUSTTAIL return objcRetainAndReturn(object);
611611
#else
612-
return swift_retain(static_cast<HeapObject *>(objectRef));
612+
// No tail call here. When !SWIFT_OBJC_INTEROP, the value of objectRef may be
613+
// different from that of object, e.g. on Linux ARM64.
614+
swift_retain(static_cast<HeapObject *>(objectRef));
615+
return object;
613616
#endif
614617
}
615618

0 commit comments

Comments
 (0)