Skip to content

Commit 2062b33

Browse files
authored
Merge pull request #82312 from mikeash/swift-retain-method-tail-call
[Runtime] Tail call swift_retain in ObjC retain implementation.
2 parents ede7bdb + 90cfaa1 commit 2062b33

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

include/swift/Runtime/HeapObject.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1159,8 +1159,7 @@ swift_getMangledTypeName(const Metadata *type);
11591159
#define STANDARD_OBJC_METHOD_IMPLS_FOR_SWIFT_OBJECTS \
11601160
- (id)retain { \
11611161
auto SELF = reinterpret_cast<HeapObject *>(self); \
1162-
swift_retain(SELF); \
1163-
return self; \
1162+
return reinterpret_cast<id>(swift_retain(SELF)); \
11641163
} \
11651164
- (oneway void)release { \
11661165
auto SELF = reinterpret_cast<HeapObject *>(self); \

0 commit comments

Comments
 (0)