summaryrefslogtreecommitdiffstats
path: root/lldb/source/Symbol/ClangASTImporter.cpp
diff options
context:
space:
mode:
authorStephane Sezer <sas@cd80.net>2015-04-08 21:52:45 +0000
committerStephane Sezer <sas@cd80.net>2015-04-08 21:52:45 +0000
commit9901e9c6c8cdfe4aa01cec97b3273119228af51b (patch)
tree1270445586e0856b263c1722256068819345144d /lldb/source/Symbol/ClangASTImporter.cpp
parent576ff1283997d67e89bc958a1eeb25215a3c66c2 (diff)
downloadbcm5719-llvm-9901e9c6c8cdfe4aa01cec97b3273119228af51b.tar.gz
bcm5719-llvm-9901e9c6c8cdfe4aa01cec97b3273119228af51b.zip
Fix resolution of certain recursive types.
Summary: If a struct type S has a member T that has a member that is a function that returns a typedef of S* the respective field would be duplicated, which caused an assert down the line in RecordLayoutBuilder. This patch adds a check that removes the possibility of trying to resolve the same type twice within the same callstack. This commit also adds unit tests for these failures. Fixes https://llvm.org/bugs/show_bug.cgi?id=20486. Patch by Cristian Hancila. Test Plan: Run unit tests. Reviewers: clayborg spyffe Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D8561 llvm-svn: 234441
Diffstat (limited to 'lldb/source/Symbol/ClangASTImporter.cpp')
-rw-r--r--lldb/source/Symbol/ClangASTImporter.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/lldb/source/Symbol/ClangASTImporter.cpp b/lldb/source/Symbol/ClangASTImporter.cpp
index a925f808f85..7abca556efe 100644
--- a/lldb/source/Symbol/ClangASTImporter.cpp
+++ b/lldb/source/Symbol/ClangASTImporter.cpp
@@ -286,7 +286,12 @@ ClangASTImporter::RequireCompleteType (clang::QualType type)
if (const TagType *tag_type = type->getAs<TagType>())
{
- return CompleteTagDecl(tag_type->getDecl());
+ TagDecl *tag_decl = tag_type->getDecl();
+
+ if (tag_decl->getDefinition() || tag_decl->isBeingDefined())
+ return true;
+
+ return CompleteTagDecl(tag_decl);
}
if (const ObjCObjectType *objc_object_type = type->getAs<ObjCObjectType>())
{
OpenPOWER on IntegriCloud