summaryrefslogtreecommitdiff
path: root/libsanitizer
diff options
context:
space:
mode:
authorMartin Liska <mliska@suse.cz>2019-03-06 12:46:15 +0100
committerMartin Liska <marxin@gcc.gnu.org>2019-03-06 11:46:15 +0000
commitc24847a54abe6b93139f92318f254d1952315ba2 (patch)
tree7b998e55dcf8ec69c854ff358894ee0b19a79f23 /libsanitizer
parentd80f04d61e11a103e2e463a1a90a3d780b0fd99b (diff)
downloadgcc-c24847a54abe6b93139f92318f254d1952315ba2.tar.gz
Charry pick libsanitizer r355488 (PR sanitizer/88684).
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
Diffstat (limited to 'libsanitizer')
-rw-r--r--libsanitizer/ChangeLog8
-rw-r--r--libsanitizer/sanitizer_common/sanitizer_platform.h6
-rw-r--r--libsanitizer/ubsan/ubsan_type_hash_itanium.cc1
3 files changed, 12 insertions, 3 deletions
diff --git a/libsanitizer/ChangeLog b/libsanitizer/ChangeLog
index c7cc662af15..296d4bedc9e 100644
--- a/libsanitizer/ChangeLog
+++ b/libsanitizer/ChangeLog
@@ -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
diff --git a/libsanitizer/sanitizer_common/sanitizer_platform.h b/libsanitizer/sanitizer_common/sanitizer_platform.h
index 352b374e177..192667989f4 100644
--- a/libsanitizer/sanitizer_common/sanitizer_platform.h
+++ b/libsanitizer/sanitizer_common/sanitizer_platform.h
@@ -290,10 +290,10 @@
# 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
diff --git a/libsanitizer/ubsan/ubsan_type_hash_itanium.cc b/libsanitizer/ubsan/ubsan_type_hash_itanium.cc
index 9df316e14be..bff78887396 100644
--- a/libsanitizer/ubsan/ubsan_type_hash_itanium.cc
+++ b/libsanitizer/ubsan/ubsan_type_hash_itanium.cc
@@ -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;