[compiler-rt] r177618 - Per discussion on cxx-abi-dev, switch from comparing type_info objects to

Richard Smith richard-llvm at metafoo.co.uk
Wed Mar 20 17:42:03 PDT 2013


Author: rsmith
Date: Wed Mar 20 19:42:03 2013
New Revision: 177618

URL: http://llvm.org/viewvc/llvm-project?rev=177618&view=rev
Log:
Per discussion on cxx-abi-dev, switch from comparing type_info objects to
comparing type_info names, since the latter have better uniqueness guarantees
in practice.

Modified:
    compiler-rt/trunk/lib/ubsan/ubsan_type_hash.cc

Modified: compiler-rt/trunk/lib/ubsan/ubsan_type_hash.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/ubsan/ubsan_type_hash.cc?rev=177618&r1=177617&r2=177618&view=diff
==============================================================================
--- compiler-rt/trunk/lib/ubsan/ubsan_type_hash.cc (original)
+++ compiler-rt/trunk/lib/ubsan/ubsan_type_hash.cc Wed Mar 20 19:42:03 2013
@@ -116,7 +116,7 @@ __ubsan::__ubsan_vptr_type_cache[__ubsan
 static bool isDerivedFromAtOffset(const abi::__class_type_info *Derived,
                                   const abi::__class_type_info *Base,
                                   sptr Offset) {
-  if (Derived == Base)
+  if (Derived->__type_name == Base->__type_name)
     return Offset == 0;
 
   if (const abi::__si_class_type_info *SI =





More information about the llvm-commits mailing list