bug fix in ClangASTType when trying to get size of a non-complete type

llvm-svn: 135989
This commit is contained in:
Enrico Granata 2011-07-25 22:19:19 +00:00
parent 990f771a9a
commit 77d24d374a
1 changed files with 6 additions and 2 deletions

View File

@ -1373,9 +1373,13 @@ ClangASTType::GetTypeByteSize(
clang::ASTContext *ast_context,
lldb::clang_type_t opaque_clang_qual_type)
{
clang::QualType qual_type(clang::QualType::getFromOpaquePtr(opaque_clang_qual_type));
return (ast_context->getTypeSize (qual_type) + 7) / 8;
if (ClangASTContext::GetCompleteType (ast_context, opaque_clang_qual_type))
{
clang::QualType qual_type(clang::QualType::getFromOpaquePtr(opaque_clang_qual_type));
return (ast_context->getTypeSize (qual_type) + 7) / 8;
}
return UINT32_MAX;
}