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); } }