[Lldb-commits] [PATCH] Don't crash if a member declaration is incomplete

Greg Clayton clayborg at gmail.com
Wed Jun 17 10:42:11 PDT 2015


Changes to ClangASTType::StartTagDeclarationDefinition() should not be needed. Please verify that the CXXRecordDecl is handled by the TagDecl:

  const clang::Type *t = qual_type.getTypePtr();
  if (t)
  {
      const clang::TagType *tag_type = llvm::dyn_cast<clang::TagType>(t);
      if (tag_type)
      {
          clang::TagDecl *tag_decl = tag_type->getDecl();
          if (tag_decl)
          {
              tag_decl->startDefinition();
              return true;
          }
      }


REPOSITORY
  rL LLVM

================
Comment at: source/Symbol/ClangASTType.cpp:5851-5857
@@ -5850,2 +5850,9 @@
         clang::QualType qual_type (GetQualType());
+        clang::CXXRecordDecl *cxx_record_decl = qual_type->getAsCXXRecordDecl();
+        if (cxx_record_decl)
+        {
+            cxx_record_decl->startDefinition();
+            return true;
+        }
+
         const clang::Type *t = qual_type.getTypePtr();
----------------
This patch is not needed. CXXRecordDecl is a TagType and it will be handled by the code below.

http://reviews.llvm.org/D10509

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the lldb-commits mailing list