diff options
| author | Sean Callanan <scallanan@apple.com> | 2013-02-06 23:21:59 +0000 |
|---|---|---|
| committer | Sean Callanan <scallanan@apple.com> | 2013-02-06 23:21:59 +0000 |
| commit | c3a1d5629acd8e0226fc929330e3234a39e908e1 (patch) | |
| tree | b634dd5256d665e5d232932e8614cdf9d0d64dbc | |
| parent | 1f380ea29aa03652382db9f1458d0cd6f86d701a (diff) | |
| download | bcm5719-llvm-c3a1d5629acd8e0226fc929330e3234a39e908e1.tar.gz bcm5719-llvm-c3a1d5629acd8e0226fc929330e3234a39e908e1.zip | |
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.
<rdar://problem/12992864>
llvm-svn: 174557
| -rw-r--r-- | lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp | 7 | ||||
| -rw-r--r-- | lldb/source/Symbol/ClangASTContext.cpp | 3 |
2 files changed, 10 insertions, 0 deletions
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp index ca1ca13b26e..a5c17e1bb47 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 a5c6b1ade93..0749c845e13 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, |

