Skip to content

Commit 3cde386

Browse files
authored
Merge pull request #62030 from mikeash/fix-bridgeobjectretain-linux-arm64
[Runtime] Fix swift_bridgeObjectRetain on ARM64 Linux.
2 parents 531df99 + 4289953 commit 3cde386

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)