From: Sean Callanan Date: Wed, 6 Feb 2013 23:21:59 +0000 (+0000) Subject: Fixed a problem that would cause LLDB to crash X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c3a1d5629acd8e0226fc929330e3234a39e908e1;p=platform%2Fupstream%2Fllvm.git Fixed a problem that would cause LLDB to crash if it encountered bad debug information. This debug information had an Objective-C method whose selector disagreed with the true number of arguments to that method. llvm-svn: 174557 --- diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp index ca1ca13..a5c17e1 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp @@ -6309,6 +6309,13 @@ SymbolFileDWARF::ParseType (const SymbolContext& sc, DWARFCompileUnit* dwarf_cu, LinkDeclContextToDIE(ClangASTContext::GetAsDeclContext(objc_method_decl), die); GetClangASTContext().SetMetadataAsUserID ((uintptr_t)objc_method_decl, MakeUserID(die->GetOffset())); } + else + { + GetObjectFile()->GetModule()->ReportError ("{0x%8.8x}: invaliad Objective-C method 0x%4.4x (%s), please file a bug and attach the file at the start of this error message", + die->GetOffset(), + tag, + DW_TAG_value_to_name(tag)); + } } } else if (is_cxx_method) diff --git a/lldb/source/Symbol/ClangASTContext.cpp b/lldb/source/Symbol/ClangASTContext.cpp index a5c6b1a..0749c84 100644 --- a/lldb/source/Symbol/ClangASTContext.cpp +++ b/lldb/source/Symbol/ClangASTContext.cpp @@ -2722,6 +2722,9 @@ ClangASTContext::AddMethodToObjCObjectType ObjCMethodDecl::ImplementationControl imp_control = ObjCMethodDecl::None; const unsigned num_args = method_function_prototype->getNumArgs(); + + if (num_args != num_selectors_with_args) + return NULL; // some debug information is corrupt. We are not going to deal with it. ObjCMethodDecl *objc_method_decl = ObjCMethodDecl::Create (*ast, SourceLocation(), // beginLoc,