From b4c351dfd1d07ca7aa3f8e1c9fa25588d95b8638 Mon Sep 17 00:00:00 2001 From: Kevin Enderby Date: Thu, 20 Jul 2017 23:09:19 +0000 Subject: [PATCH] lld matching change for llvm change r308690 to add error handling to the dyld compact export entries in libObject. llvm-svn: 308691 --- .../ReaderWriter/MachO/MachONormalizedFileBinaryReader.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lld/lib/ReaderWriter/MachO/MachONormalizedFileBinaryReader.cpp b/lld/lib/ReaderWriter/MachO/MachONormalizedFileBinaryReader.cpp index b54054726dfe..2f91818f1872 100644 --- a/lld/lib/ReaderWriter/MachO/MachONormalizedFileBinaryReader.cpp +++ b/lld/lib/ReaderWriter/MachO/MachONormalizedFileBinaryReader.cpp @@ -511,7 +511,8 @@ readBinary(std::unique_ptr &mb, const uint8_t *trieStart = reinterpret_cast( start + read32(&dyldInfo->export_off, isBig)); ArrayRef trie(trieStart, read32(&dyldInfo->export_size, isBig)); - for (const ExportEntry &trieExport : MachOObjectFile::exports(trie)) { + Error Err = Error::success(); + for (const ExportEntry &trieExport : MachOObjectFile::exports(Err, trie)) { Export normExport; normExport.name = trieExport.name().copy(f->ownedAllocations); normExport.offset = trieExport.address(); @@ -522,6 +523,8 @@ readBinary(std::unique_ptr &mb, normExport.otherName = trieExport.otherName().copy(f->ownedAllocations); f->exportInfo.push_back(normExport); } + if (Err) + return std::move(Err); } }