Skip to content

Commit

Permalink
Fix potential nullptr dereference in UdtFieldDefinition::VisitBaseType
Browse files Browse the repository at this point in the history
Fixes #12
  • Loading branch information
Mattiwatti authored and wbenny committed Jun 29, 2021
1 parent 43517b7 commit 6b143a9
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Source/UdtFieldDefinition.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,13 @@ class UdtFieldDefinition
m_TypePrefix += "volatile ";
}

m_TypePrefix += PDB::GetBasicTypeString(Symbol, m_Settings->UseStdInt);
//
// If this returns null, it probably means BasicTypeMapMSVC and/or BasicTypeMapStdInt are out of date compared to MS DIA.
// Output the (non-compilable) type "<unknown_type>" instead of crashing.
//

const CHAR* BasicTypeString = PDB::GetBasicTypeString(Symbol, m_Settings->UseStdInt);
m_TypePrefix += (BasicTypeString != nullptr ? BasicTypeString : "<unknown_type>");
}

void
Expand Down

0 comments on commit 6b143a9

Please sign in to comment.