Charry pick libsanitizer r355488 (PR sanitizer/88684).
authorMartin Liska <mliska@suse.cz>
Wed, 6 Mar 2019 11:46:15 +0000 (12:46 +0100)
committerMartin Liska <marxin@gcc.gnu.org>
Wed, 6 Mar 2019 11:46:15 +0000 (11:46 +0000)
2019-03-06  Martin Liska  <mliska@suse.cz>

PR sanitizer/88684
* sanitizer_common/sanitizer_platform.h (defined): Cherry pick.
(SANITIZER_NON_UNIQUE_TYPEINFO): Likewise.
* ubsan/ubsan_type_hash_itanium.cc (isDerivedFromAtOffset):
Likewise.

From-SVN: r269419

libsanitizer/ChangeLog
libsanitizer/sanitizer_common/sanitizer_platform.h
libsanitizer/ubsan/ubsan_type_hash_itanium.cc

index c7cc662af15a45481fd9208c62d6a6975dcede75..296d4bedc9ea42cfb5d190e0a4a56964a04df95b 100644 (file)
@@ -1,3 +1,11 @@
+2019-03-06  Martin Liska  <mliska@suse.cz>
+
+       PR sanitizer/88684
+       * sanitizer_common/sanitizer_platform.h (defined): Cherry pick.
+       (SANITIZER_NON_UNIQUE_TYPEINFO): Likewise.
+       * ubsan/ubsan_type_hash_itanium.cc (isDerivedFromAtOffset):
+       Likewise.
+
 2019-02-20  H.J. Lu  <hongjiu.lu@intel.com>
 
        PR sanitizer/89409
index 352b374e177069e4d4867e71f2284687acabdae8..192667989f487ab1673ca70687fe7c2e7cd5f1ee 100644 (file)
 # define MSC_PREREQ(version) 0
 #endif
 
-#if defined(__arm64__) && SANITIZER_IOS
-# define SANITIZER_NON_UNIQUE_TYPEINFO 1
-#else
+#if SANITIZER_MAC && !(defined(__arm64__) && SANITIZER_IOS)
 # define SANITIZER_NON_UNIQUE_TYPEINFO 0
+#else
+# define SANITIZER_NON_UNIQUE_TYPEINFO 1
 #endif
 
 // On linux, some architectures had an ABI transition from 64-bit long double
index 9df316e14be9b21316327b00e99faaafe8b2b66f..bff788873964f982e661fe5b9787839f3f572aff 100644 (file)
@@ -117,6 +117,7 @@ static bool isDerivedFromAtOffset(const abi::__class_type_info *Derived,
                                   sptr Offset) {
   if (Derived->__type_name == Base->__type_name ||
       (SANITIZER_NON_UNIQUE_TYPEINFO &&
+       Derived->__type_name[0] != '*' &&
        !internal_strcmp(Derived->__type_name, Base->__type_name)))
     return Offset == 0;