Skip to content

Commit 567988a

Browse files
nullableVoidPtremesare
authored andcommitted
MSVC RTTI: Narrow when pClassHierarchyDescriptor is recursed into
1 parent 5fcb488 commit 567988a

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

plugins/msvc_rtti/rtti.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ constexpr int COL_SIG_REV0 = 0;
66
constexpr int COL_SIG_REV1 = 1;
77
constexpr int RTTI_CONFIDENCE = 100;
88

9+
constexpr int BCD_HASPCHD = 0x40;
910

1011
ClassHierarchyDescriptor::ClassHierarchyDescriptor(BinaryView *view, uint64_t address)
1112
{
@@ -503,8 +504,10 @@ std::optional<ClassInfo> MicrosoftRTTIProcessor::ProcessRTTI(uint64_t coLocatorA
503504
m_view->DefineDataVariable(baseClassTypeDescAddr,
504505
Confidence(TypeDescriptorType(m_view, baseClassTypeDesc.name.length()), RTTI_CONFIDENCE));
505506

506-
auto classHierarchyDescAddr = resolveAddr(baseClassDesc.pClassHierarchyDescriptor);
507-
baseClasses[classHierarchyDescAddr] = baseClassInfo;
507+
if (baseClassDesc.attributes & BCD_HASPCHD) {
508+
auto classHierarchyDescAddr = resolveAddr(baseClassDesc.pClassHierarchyDescriptor);
509+
baseClasses[classHierarchyDescAddr] = baseClassInfo;
510+
}
508511
}
509512

510513
return baseClasses;

0 commit comments

Comments
 (0)