summaryrefslogtreecommitdiffstats
path: root/lldb/source/Expression
diff options
context:
space:
mode:
authorTamas Berghammer <tberghammer@google.com>2015-09-25 12:50:51 +0000
committerTamas Berghammer <tberghammer@google.com>2015-09-25 12:50:51 +0000
commit92d2c8eaefc8e54797b5b18d980be59a5e19e560 (patch)
tree98e0292323d7afef818e8483356007017e48f9b2 /lldb/source/Expression
parentc90ed44b311797c3135d8ac9ec22f7374bb17a91 (diff)
downloadbcm5719-llvm-92d2c8eaefc8e54797b5b18d980be59a5e19e560.tar.gz
bcm5719-llvm-92d2c8eaefc8e54797b5b18d980be59a5e19e560.zip
Eliminate a potential crash in the struct layout code with a gracefull fallback
Differential revision: http://reviews.llvm.org/D12963 llvm-svn: 248571
Diffstat (limited to 'lldb/source/Expression')
-rw-r--r--lldb/source/Expression/ClangASTSource.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lldb/source/Expression/ClangASTSource.cpp b/lldb/source/Expression/ClangASTSource.cpp
index ebd4d0d301c..a3d380c2125 100644
--- a/lldb/source/Expression/ClangASTSource.cpp
+++ b/lldb/source/Expression/ClangASTSource.cpp
@@ -1674,7 +1674,8 @@ ClangASTSource::layoutRecordType(const RecordDecl *record, uint64_t &size, uint6
ClangASTContext::GetCompleteDecl(&origin_record->getASTContext(), const_cast<RecordDecl*>(origin_record.decl));
- if (!origin_record.decl->getDefinition())
+ clang::RecordDecl* definition = origin_record.decl->getDefinition();
+ if (!definition || !definition->isCompleteDefinition())
return false;
const ASTRecordLayout &record_layout(origin_record->getASTContext().getASTRecordLayout(origin_record.decl));
OpenPOWER on IntegriCloud