Changeset View
Changeset View
Standalone View
Standalone View
lib/ubsan/ubsan_type_hash_itanium.cc
Show First 20 Lines • Show All 112 Lines • ▼ Show 20 Lines | |||||
/// \brief Determine whether \p Derived has a \p Base base class subobject at | /// \brief Determine whether \p Derived has a \p Base base class subobject at | ||||
/// offset \p Offset. | /// offset \p Offset. | ||||
static bool isDerivedFromAtOffset(const abi::__class_type_info *Derived, | static bool isDerivedFromAtOffset(const abi::__class_type_info *Derived, | ||||
const abi::__class_type_info *Base, | const abi::__class_type_info *Base, | ||||
sptr Offset) { | sptr Offset) { | ||||
if (Derived->__type_name == Base->__type_name || | if (Derived->__type_name == Base->__type_name || | ||||
(SANITIZER_NON_UNIQUE_TYPEINFO && | (SANITIZER_NON_UNIQUE_TYPEINFO && | ||||
Derived->__type_name[0] != '*' && | |||||
!internal_strcmp(Derived->__type_name, Base->__type_name))) | !internal_strcmp(Derived->__type_name, Base->__type_name))) | ||||
return Offset == 0; | return Offset == 0; | ||||
if (const abi::__si_class_type_info *SI = | if (const abi::__si_class_type_info *SI = | ||||
dynamic_cast<const abi::__si_class_type_info*>(Derived)) | dynamic_cast<const abi::__si_class_type_info*>(Derived)) | ||||
return isDerivedFromAtOffset(SI->__base_type, Base, Offset); | return isDerivedFromAtOffset(SI->__base_type, Base, Offset); | ||||
const abi::__vmi_class_type_info *VTI = | const abi::__vmi_class_type_info *VTI = | ||||
▲ Show 20 Lines • Show All 132 Lines • Show Last 20 Lines |