This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Cherry pick libsanitizer r355488 (PR sanitizer/88684).


Hi.

The patch is a cherry pick from libsanitizer.

Patch can bootstrap on x86_64-linux-gnu and survives regression tests.
I'm going to install the patch.

Thanks,
Martin

libsanitizer/ChangeLog:

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.
---
 libsanitizer/sanitizer_common/sanitizer_platform.h | 6 +++---
 libsanitizer/ubsan/ubsan_type_hash_itanium.cc      | 1 +
 2 files changed, 4 insertions(+), 3 deletions(-)


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;
 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]