[llvm] r217909 - [llvm-objdump] improve error reporting of bad mach-o ordinals
Nick Kledzik
kledzik at apple.com
Tue Sep 16 15:03:13 PDT 2014
Author: kledzik
Date: Tue Sep 16 17:03:13 2014
New Revision: 217909
URL: http://llvm.org/viewvc/llvm-project?rev=217909&view=rev
Log:
[llvm-objdump] improve error reporting of bad mach-o ordinals
Modified:
llvm/trunk/tools/llvm-objdump/MachODump.cpp
Modified: llvm/trunk/tools/llvm-objdump/MachODump.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-objdump/MachODump.cpp?rev=217909&r1=217908&r2=217909&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-objdump/MachODump.cpp (original)
+++ llvm/trunk/tools/llvm-objdump/MachODump.cpp Tue Sep 16 17:03:13 2014
@@ -2446,9 +2446,15 @@ static StringRef ordinalName(const objec
case MachO::BIND_SPECIAL_DYLIB_FLAT_LOOKUP:
return "flat-namespace";
default:
- Obj->getLibraryShortNameByIndex(Ordinal-1, DylibName);
- return DylibName;
+ if (Ordinal > 0) {
+ std::error_code EC = Obj->getLibraryShortNameByIndex(Ordinal-1,
+ DylibName);
+ if (EC)
+ return "<<ordinal too big>>";
+ return DylibName;
+ }
}
+ return "<<unknown special ordinal>>";
}
//===----------------------------------------------------------------------===//
More information about the llvm-commits
mailing list