[Lldb-commits] [lldb] r248571 - Eliminate a potential crash in the struct layout code with a gracefull fallback
Tamas Berghammer via lldb-commits
lldb-commits at lists.llvm.org
Fri Sep 25 05:50:51 PDT 2015
Author: tberghammer
Date: Fri Sep 25 07:50:51 2015
New Revision: 248571
URL: http://llvm.org/viewvc/llvm-project?rev=248571&view=rev
Log:
Eliminate a potential crash in the struct layout code with a gracefull fallback
Differential revision: http://reviews.llvm.org/D12963
Modified:
lldb/trunk/source/Expression/ClangASTSource.cpp
Modified: lldb/trunk/source/Expression/ClangASTSource.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/ClangASTSource.cpp?rev=248571&r1=248570&r2=248571&view=diff
==============================================================================
--- lldb/trunk/source/Expression/ClangASTSource.cpp (original)
+++ lldb/trunk/source/Expression/ClangASTSource.cpp Fri Sep 25 07:50:51 2015
@@ -1674,7 +1674,8 @@ ClangASTSource::layoutRecordType(const R
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));
More information about the lldb-commits
mailing list