From cedb0b6b7e2fb9446ef9a34706f68a9f70c32a43 Mon Sep 17 00:00:00 2001 From: Kevin Enderby Date: Fri, 5 Aug 2016 18:19:40 +0000 Subject: Add the first of what will be a long line of additional error checks for invalid Mach-O files. This is where an LC_SEGMENT load command has a fileoff field that extends past the end of the file. Also fix llvm-nm and llvm-size to remove the errorToErrorCode() call so error messages are printed. And needed to update a few test cases now that they do print the error messages just a bit differently. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277845 91177308-0d34-0410-b5e6-96231b3b80d8 --- tools/llvm-nm/llvm-nm.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tools/llvm-nm') diff --git a/tools/llvm-nm/llvm-nm.cpp b/tools/llvm-nm/llvm-nm.cpp index af3d7db1dda..7eb937453ac 100644 --- a/tools/llvm-nm/llvm-nm.cpp +++ b/tools/llvm-nm/llvm-nm.cpp @@ -1085,7 +1085,7 @@ static void dumpSymbolNamesFromFile(std::string &Filename) { Expected> BinaryOrErr = createBinary( BufferOrErr.get()->getMemBufferRef(), NoLLVMBitcode ? nullptr : &Context); if (!BinaryOrErr) { - error(errorToErrorCode(BinaryOrErr.takeError()), Filename); + error(BinaryOrErr.takeError(), Filename); return; } Binary &Bin = *BinaryOrErr.get(); -- cgit v1.2.3