siggi-alpheus created this revision. siggi-alpheus added reviewers: labath, jasonmolenda. siggi-alpheus added a project: LLDB. Herald added a subscriber: JDevlieghere. Herald added a project: All. siggi-alpheus requested review of this revision. Herald added a subscriber: lldb-commits.
See issue 54761 <https://github.com/llvm/llvm-project/issues/54761>. It looks like Google Chrome's symbols contain some member functions whose this pointer type is missing, which causes a nullptr access and a crash. This patch makes lldb tolerant of this problem by avoiding the nullptr access. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D123415 Files: lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp Index: lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp =================================================================== --- lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp +++ lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp @@ -7571,7 +7571,8 @@ clang::CXXRecordDecl *cxx_record_decl = record_qual_type->getAsCXXRecordDecl(); - if (cxx_record_decl == nullptr) + // Bail if no declaration or if the declaration has no definition. + if (cxx_record_decl == nullptr || !cxx_record_decl->hasDefinition()) return nullptr; clang::QualType method_qual_type(ClangUtil::GetQualType(method_clang_type));
Index: lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp =================================================================== --- lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp +++ lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp @@ -7571,7 +7571,8 @@ clang::CXXRecordDecl *cxx_record_decl = record_qual_type->getAsCXXRecordDecl(); - if (cxx_record_decl == nullptr) + // Bail if no declaration or if the declaration has no definition. + if (cxx_record_decl == nullptr || !cxx_record_decl->hasDefinition()) return nullptr; clang::QualType method_qual_type(ClangUtil::GetQualType(method_clang_type));
_______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits