diff options
| author | Greg Clayton <gclayton@apple.com> | 2016-03-29 17:36:38 +0000 |
|---|---|---|
| committer | Greg Clayton <gclayton@apple.com> | 2016-03-29 17:36:38 +0000 |
| commit | 6e5c1fed08edf57725b9dc2e5c7ab429d25569a6 (patch) | |
| tree | 3ca50bb99c3ebcc87aa9b18944942262165d31fa | |
| parent | 0c18d03d9157090cb379219a8b91f3104869f358 (diff) | |
| download | bcm5719-llvm-6e5c1fed08edf57725b9dc2e5c7ab429d25569a6.tar.gz bcm5719-llvm-6e5c1fed08edf57725b9dc2e5c7ab429d25569a6.zip | |
Don't try to call getTypeSize() on a class if it isn't complete as clang will assert and kill the process.
llvm-svn: 264753
| -rw-r--r-- | lldb/source/Symbol/ClangASTContext.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/lldb/source/Symbol/ClangASTContext.cpp b/lldb/source/Symbol/ClangASTContext.cpp index 19aae6178d8..7d20439e95f 100644 --- a/lldb/source/Symbol/ClangASTContext.cpp +++ b/lldb/source/Symbol/ClangASTContext.cpp @@ -4674,8 +4674,16 @@ ClangASTContext::GetBitSize (lldb::opaque_compiler_type_t type, ExecutionContext if (GetCompleteType (type)) { clang::QualType qual_type(GetCanonicalQualType(type)); - switch (qual_type->getTypeClass()) + const clang::Type::TypeClass type_class = qual_type->getTypeClass(); + switch (type_class) { + case clang::Type::Record: + if (GetCompleteType(type)) + return getASTContext()->getTypeSize(qual_type); + else + return 0; + break; + case clang::Type::ObjCInterface: case clang::Type::ObjCObject: { |

