From f681ec5db15fc039d3c94ac03032f7b87788160d Mon Sep 17 00:00:00 2001 From: Kevin Enderby Date: Fri, 22 Jan 2016 18:47:14 +0000 Subject: =?UTF-8?q?Fix=20MachOObjectFile::getSymbolName()=20to=20not=20cal?= =?UTF-8?q?l=C2=A0report=5Ffatal=5Ferror()=20but=20to=20return=C2=A0object?= =?UTF-8?q?=5Ferror::parse=5Ffailed.=20=C2=A0Then=20made=20the=20code=20in?= =?UTF-8?q?=20llvm-nm=20do=20for=20Mach-O=20files=20what=20is=20done=20in?= =?UTF-8?q?=20the=20darwin=20native=20tools=20which=20is=20to=20print=20"b?= =?UTF-8?q?ad=20string=20index"=20for=20bad=20string=20indexes.=20=20Updat?= =?UTF-8?q?ed=20the=20error=20message=20in=20the=20llvm-objdump=20test,=20?= =?UTF-8?q?and=20added=20tests=20to=20show=20llvm-nm=20prints=20"bad=20str?= =?UTF-8?q?ing=20index"=20and=20a=20test=20to=20print=20the=20actual=20bad?= =?UTF-8?q?=20string=20index=20value=20which=20in=20this=20case=20is=200xf?= =?UTF-8?q?e000002=20when=20printing=20the=20fields=20as=20raw=20hex.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit llvm-svn: 258520 --- llvm/lib/Object/MachOObjectFile.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'llvm/lib/Object/MachOObjectFile.cpp') diff --git a/llvm/lib/Object/MachOObjectFile.cpp b/llvm/lib/Object/MachOObjectFile.cpp index 4ba6523..3fb8e53 100644 --- a/llvm/lib/Object/MachOObjectFile.cpp +++ b/llvm/lib/Object/MachOObjectFile.cpp @@ -332,8 +332,7 @@ ErrorOr MachOObjectFile::getSymbolName(DataRefImpl Symb) const { MachO::nlist_base Entry = getSymbolTableEntryBase(this, Symb); const char *Start = &StringTable.data()[Entry.n_strx]; if (Start < getData().begin() || Start >= getData().end()) - report_fatal_error( - "Symbol name entry points before beginning or past end of file."); + return object_error::parse_failed; return StringRef(Start); } -- cgit v1.1