Moved byte-size computation out of a

startDefinition() ... endDefinition() block,
preventing crashes where the byte size of a
not-yet-complete type was being computed.

llvm-svn: 151546
This commit is contained in:
Sean Callanan 2012-02-27 20:07:01 +00:00
parent 5e8636f36e
commit 77a1fd3f45
1 changed files with 133 additions and 130 deletions

View File

@ -1919,9 +1919,11 @@ SymbolFileDWARF::ResolveClangOpaqueTypeDefinition (lldb::clang_type_t clang_type
case DW_TAG_structure_type:
case DW_TAG_union_type:
case DW_TAG_class_type:
ast.StartTagDeclarationDefinition (clang_type);
{
LayoutInfo layout_info;
ast.StartTagDeclarationDefinition (clang_type);
{
if (die->HasChildren())
{
@ -2063,8 +2065,9 @@ SymbolFileDWARF::ResolveClangOpaqueTypeDefinition (lldb::clang_type_t clang_type
ClangASTContext::DeleteBaseClassSpecifiers (&base_classes.front(),
base_classes.size());
}
}
}
ast.CompleteTagDeclarationDefinition (clang_type);
if (!layout_info.field_offsets.empty())
{
@ -2102,7 +2105,7 @@ SymbolFileDWARF::ResolveClangOpaqueTypeDefinition (lldb::clang_type_t clang_type
}
}
}
ast.CompleteTagDeclarationDefinition (clang_type);
return clang_type;
case DW_TAG_enumeration_type: