Skip to content

Commit 701c702

Browse files
emesareplafosse
authored andcommitted
Fix misc invalid root type info construction in Itanium RTTI
Fixes #6692
1 parent 9410640 commit 701c702

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

plugins/rtti/itanium.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,13 @@ std::optional<TypeInfoVariant> ReadTypeInfoVariant(BinaryView *view, uint64_t ob
330330
auto baseSymName = baseSym->GetShortName();
331331
if (baseSymName.find("__cxxabiv1") != std::string::npos)
332332
{
333+
// Skip char array base data variables. This fixes the root base types being constructed twice at 0x0 and +0x8.
334+
// 1400f81a0 void* _typeinfo_for___cxxabiv1::__class_type_info = data_1400fce10 <---- First at 0x0
335+
// 1400f81a8 struct __cxxabiv1::__class_type_info _typeinfo_for_��@ = <----- Second at 0x8
336+
DataVariable baseDV;
337+
if (view->GetDataVariableAtAddress(typeInfo->base, baseDV) && baseDV.type->IsArray())
338+
return std::nullopt;
339+
333340
// symbol takes the form of `abi::base_name::addend`
334341
if (baseSymName.find("si_class_type_info") != std::string::npos)
335342
return TIVSIClass;

0 commit comments

Comments
 (0)