Skip to content

Commit d5016e9

Browse files
committed
fix(runtime): test ObjC tagged pointers through void* for Release builds
clang rejects bit tests on ObjC object pointers under -Werror (-Wdeprecated-objc-pointer-introspection), which broke the x86_64 simulator archive.
1 parent 12ff142 commit d5016e9

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

‎NativeScript/runtime/ObjectManager.mm‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,12 @@
5353
};
5454

5555
bool IsTaggedPointer(id obj) {
56+
// Through void*: clang rejects bit tests on ObjC object pointers.
57+
uintptr_t bits = reinterpret_cast<uintptr_t>(static_cast<const void*>(obj));
5658
#if defined(__arm64__)
57-
return reinterpret_cast<intptr_t>(obj) < 0;
59+
return (bits >> 63) != 0;
5860
#else
59-
return (reinterpret_cast<uintptr_t>(obj) & 1) != 0;
61+
return (bits & 1) != 0;
6062
#endif
6163
}
6264

0 commit comments

Comments
 (0)