[Lldb-commits] [PATCH] D12963: 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 18 07:34:22 PDT 2015


tberghammer created this revision.
tberghammer added a reviewer: spyffe.
tberghammer added a subscriber: lldb-commits.

Eliminate a potential crash in the struct layout code with a gracefull fallback

http://reviews.llvm.org/D12963

Files:
  source/Expression/ClangASTSource.cpp

Index: source/Expression/ClangASTSource.cpp
===================================================================
--- source/Expression/ClangASTSource.cpp
+++ source/Expression/ClangASTSource.cpp
@@ -1674,7 +1674,8 @@
 
     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));


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D12963.35084.patch
Type: text/x-patch
Size: 658 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20150918/b5e2b15a/attachment.bin>


More information about the lldb-commits mailing list