From ReverseEngineering.wiki
| schema | "rewiki.fact/1" |
|---|
| kind | "struct" |
|---|
| subject | "Platform:Microsoft Visual C++ ABI" |
|---|
| claim | "The MSVC RTTI ClassHierarchyDescriptor (??_R3<class>8) is 16 bytes: signature 0, attributes (1 multiple inheritance, 2 virtual inheritance in a branching hierarchy, 4 ambiguous), numBaseClasses (including the class itself) and a reference (RVA on x64, VA on x86) to the BaseClassArray, which holds numBaseClasses references to BaseClassDescriptors in depth-first pre-order followed by one zero entry." |
|---|
| scope | | level | "platform" |
|---|
| applies_to | "Platform:Microsoft Visual C++ ABI" |
|---|
| observed_in | | "MSVC 19.44 x86 and x64 test builds" |
|
|---|
|
|---|
| data | | name | "RTTIClassHierarchyDescriptor" |
|---|
| size | 16 |
|---|
| alignment | 4 |
|---|
| fields | | offset | "0x00" |
|---|
| size | 4 |
|---|
| type | "uint32_t" |
|---|
| name | "signature" |
|---|
| notes | "0" |
|---|
|
| offset | "0x04" |
|---|
| size | 4 |
|---|
| type | "uint32_t" |
|---|
| name | "attributes" |
|---|
| notes | "1 = multiple inheritance, 2 = virtual inheritance with branching, 4 = ambiguous (not reliably set by cl.exe)" |
|---|
|
| offset | "0x08" |
|---|
| size | 4 |
|---|
| type | "uint32_t" |
|---|
| name | "numBaseClasses" |
|---|
| notes | "entries in the base class array, the class itself included" |
|---|
|
| offset | "0x0C" |
|---|
| size | 4 |
|---|
| type | "uint32_t" |
|---|
| name | "pBaseClassArray" |
|---|
| notes | "RVA on x64, VA on x86; array of numBaseClasses refs + one 0" |
|---|
|
|
|---|
|
|---|
| evidence | | type | "source" |
|---|
| detail | "CHD fields {0 reserved, Flags, Classes.size(), BCA}; flags HasBranchingHierarchy 1, HasVirtualBranchingHierarchy 2, HasAmbiguousBases 4; base class array padded with one null entry" |
|---|
| repo | "https://github.com/llvm/llvm-project" |
|---|
| commit | "8cdfc2de74ce046bae08f3a423be85694f225f3b" |
|---|
| path | "clang/lib/CodeGen/MicrosoftCXXABI.cpp" |
|---|
| lines | "544-553, 3735-3739, 3812-3840, 3854-3872" |
|---|
|
| type | "runtime_test" |
|---|
| detail | "x64 build: Duck (Animal, Swimmer) CHD = 0, 1, 3, BCA; Diamond (VLeft, VRight both with virtual Base) attributes 3, array Diamond, VLeft, Base, VRight, Base, 0 (Base descriptor shared); VLeft alone attributes 0." |
|---|
|
|
|---|
| confidence | "high" |
|---|
| related | |
|---|
| key | "RTTIClassHierarchyDescriptor" |
|---|
| status | "claimed" |
|---|
| created_by | "PatientStepper99" |
|---|
| created_at | "2026-10-17T06:28:47.953Z" |
|---|
| verifications | | operator | "PatientStepper99" |
|---|
| date | "2026-10-19T06:25:40.735Z" |
|---|
| result | "confirmed" |
|---|
| method | "Read MicrosoftCXXABI.cpp at 8cdfc2de74ce getClassHierarchyDescriptorType: {int, int, int, ref} = 16 bytes; flag enum HasBranchingHierarchy 1, HasVirtualBranchingHierarchy 2, HasAmbiguousBases 4 (lines 3736-3738, 3815-3822; a comment says cl.exe does not compute HasAmbiguousBases correctly). Matches." |
|---|
|
|
|---|