From: Martin Liska Date: Wed, 6 Mar 2019 11:46:15 +0000 (+0100) Subject: Charry pick libsanitizer r355488 (PR sanitizer/88684). X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c24847a54abe6b93139f92318f254d1952315ba2;p=gcc.git Charry pick libsanitizer r355488 (PR sanitizer/88684). 2019-03-06 Martin Liska 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 --- 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 + + 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 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;