diff options
| author | Martin Liska <mliska@suse.cz> | 2019-03-06 08:36:50 +0000 |
|---|---|---|
| committer | Martin Liska <mliska@suse.cz> | 2019-03-06 08:36:50 +0000 |
| commit | a25a2c7c9a7e1e328a5bd8274d2d86b1fadc4692 (patch) | |
| tree | 002f80fde726aa6a9b8d39fd9e701c9c486160b0 /compiler-rt | |
| parent | af92b7a3b899ba72b48b35b0006c58b1dfcb43c0 (diff) | |
| download | bcm5719-llvm-a25a2c7c9a7e1e328a5bd8274d2d86b1fadc4692.tar.gz bcm5719-llvm-a25a2c7c9a7e1e328a5bd8274d2d86b1fadc4692.zip | |
Always compare C++ typeinfo (based on libstdc++ implementation).
Differential Revision: https://reviews.llvm.org/D58028
llvm-svn: 355488
Diffstat (limited to 'compiler-rt')
| -rw-r--r-- | compiler-rt/lib/sanitizer_common/sanitizer_platform.h | 6 | ||||
| -rw-r--r-- | compiler-rt/lib/ubsan/ubsan_type_hash_itanium.cc | 1 |
2 files changed, 4 insertions, 3 deletions
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform.h b/compiler-rt/lib/sanitizer_common/sanitizer_platform.h index ce3a84af2d8..7ba080e6f47 100644 --- a/compiler-rt/lib/sanitizer_common/sanitizer_platform.h +++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform.h @@ -285,10 +285,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/compiler-rt/lib/ubsan/ubsan_type_hash_itanium.cc b/compiler-rt/lib/ubsan/ubsan_type_hash_itanium.cc index 6337d93d7dc..3d5e536d39d 100644 --- a/compiler-rt/lib/ubsan/ubsan_type_hash_itanium.cc +++ b/compiler-rt/lib/ubsan/ubsan_type_hash_itanium.cc @@ -118,6 +118,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; |

