[Lldb-commits] [lldb] r154234 - /lldb/trunk/source/Expression/ClangASTSource.cpp
Sean Callanan
scallanan at apple.com
Fri Apr 6 17:06:01 PDT 2012
Author: spyffe
Date: Fri Apr 6 19:06:00 2012
New Revision: 154234
URL: http://llvm.org/viewvc/llvm-project?rev=154234&view=rev
Log:
Hardened the struct layout code to eliminate a
potential crash if the underlying type couldn't
be completed.
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=154234&r1=154233&r2=154234&view=diff
==============================================================================
--- lldb/trunk/source/Expression/ClangASTSource.cpp (original)
+++ lldb/trunk/source/Expression/ClangASTSource.cpp Fri Apr 6 19:06:00 2012
@@ -1183,6 +1183,11 @@
BaseOffsetMap origin_base_offsets;
BaseOffsetMap origin_virtual_base_offsets;
+ ClangASTContext::GetCompleteDecl(&origin_record->getASTContext(), const_cast<RecordDecl*>(origin_record.decl));
+
+ if (!origin_record.decl->getDefinition())
+ return false;
+
const ASTRecordLayout &record_layout(origin_record->getASTContext().getASTRecordLayout(origin_record.decl));
int field_idx = 0;
More information about the lldb-commits
mailing list