[llvm] r217909 - [llvm-objdump] improve error reporting of bad mach-o ordinals
Rafael EspĂndola
rafael.espindola at gmail.com
Tue Sep 16 20:56:21 PDT 2014
testcase?
On 16 September 2014 18:03, Nick Kledzik <kledzik at apple.com> wrote:
> 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>>";
> }
>
> //===----------------------------------------------------------------------===//
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
More information about the llvm-commits
mailing list