From 1d364c18e2b62fd0ff27191fc0511d567a2b2bce Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Tue, 3 Jun 2014 04:41:30 +0000 Subject: [PATCH] This lambda returns a boolean, update the return statements. llvm-svn: 210071 --- .../ReaderWriter/MachO/MachONormalizedFileBinaryReader.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lld/lib/ReaderWriter/MachO/MachONormalizedFileBinaryReader.cpp b/lld/lib/ReaderWriter/MachO/MachONormalizedFileBinaryReader.cpp index ce10867..f97defd 100644 --- a/lld/lib/ReaderWriter/MachO/MachONormalizedFileBinaryReader.cpp +++ b/lld/lib/ReaderWriter/MachO/MachONormalizedFileBinaryReader.cpp @@ -234,7 +234,7 @@ readBinary(std::unique_ptr &mb, + sectionCount*sizeof(section_64); // Verify sections don't extend beyond end of segment load command. if (lcSize > size) - return llvm::make_error_code(llvm::errc::executable_format_error); + return true; for (unsigned i=0; i < sectionCount; ++i) { const section_64 *sect = §s[i]; Section section; @@ -276,7 +276,7 @@ readBinary(std::unique_ptr &mb, + sectionCount*sizeof(section); // Verify sections don't extend beyond end of segment load command. if (lcSize > size) - return llvm::make_error_code(llvm::errc::executable_format_error); + return true; for (unsigned i=0; i < sectionCount; ++i) { const section *sect = §s[i]; Section section; @@ -314,12 +314,12 @@ readBinary(std::unique_ptr &mb, // Validate string pool and symbol table all in buffer. if ( read32(swap, st->stroff)+read32(swap, st->strsize) > objSize ) - return llvm::make_error_code(llvm::errc::executable_format_error); + return true; if (is64) { const uint32_t symOffset = read32(swap, st->symoff); const uint32_t symCount = read32(swap, st->nsyms); if ( symOffset+(symCount*sizeof(nlist_64)) > objSize) - return llvm::make_error_code(llvm::errc::executable_format_error); + return true; const nlist_64 *symbols = reinterpret_cast(start + symOffset); // Convert each nlist_64 to a lld::mach_o::normalized::Symbol. @@ -331,7 +331,7 @@ readBinary(std::unique_ptr &mb, } Symbol sout; if (sin->n_strx > strSize) - return llvm::make_error_code(llvm::errc::executable_format_error); + return true; sout.name = &strings[sin->n_strx]; sout.type = (NListType)(sin->n_type & N_TYPE); sout.scope = (sin->n_type & (N_PEXT|N_EXT)); @@ -349,7 +349,7 @@ readBinary(std::unique_ptr &mb, const uint32_t symOffset = read32(swap, st->symoff); const uint32_t symCount = read32(swap, st->nsyms); if ( symOffset+(symCount*sizeof(nlist)) > objSize) - return llvm::make_error_code(llvm::errc::executable_format_error); + return true; const nlist *symbols = reinterpret_cast(start + symOffset); // Convert each nlist to a lld::mach_o::normalized::Symbol. @@ -361,7 +361,7 @@ readBinary(std::unique_ptr &mb, } Symbol sout; if (sin->n_strx > strSize) - return llvm::make_error_code(llvm::errc::executable_format_error); + return true; sout.name = &strings[sin->n_strx]; sout.type = (NListType)(sin->n_type & N_TYPE); sout.scope = (sin->n_type & (N_PEXT|N_EXT)); -- 2.7.4