Skip to content

Commit a25a2c7

Browse files
committed
Always compare C++ typeinfo (based on libstdc++ implementation).
Differential Revision: https://reviews.llvm.org/D58028 llvm-svn: 355488
1 parent af92b7a commit a25a2c7

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

compiler-rt/lib/sanitizer_common/sanitizer_platform.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -285,10 +285,10 @@
285285
# define MSC_PREREQ(version) 0
286286
#endif
287287

288-
#if defined(__arm64__) && SANITIZER_IOS
289-
# define SANITIZER_NON_UNIQUE_TYPEINFO 1
290-
#else
288+
#if SANITIZER_MAC && !(defined(__arm64__) && SANITIZER_IOS)
291289
# define SANITIZER_NON_UNIQUE_TYPEINFO 0
290+
#else
291+
# define SANITIZER_NON_UNIQUE_TYPEINFO 1
292292
#endif
293293

294294
// On linux, some architectures had an ABI transition from 64-bit long double

compiler-rt/lib/ubsan/ubsan_type_hash_itanium.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ static bool isDerivedFromAtOffset(const abi::__class_type_info *Derived,
118118
sptr Offset) {
119119
if (Derived->__type_name == Base->__type_name ||
120120
(SANITIZER_NON_UNIQUE_TYPEINFO &&
121+
Derived->__type_name[0] != '*' &&
121122
!internal_strcmp(Derived->__type_name, Base->__type_name)))
122123
return Offset == 0;
123124

0 commit comments

Comments
 (0)