diff options
Diffstat (limited to 'lld/lib/ReaderWriter')
-rw-r--r-- | lld/lib/ReaderWriter/MachO/ArchHandler_x86.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lld/lib/ReaderWriter/MachO/ArchHandler_x86.cpp b/lld/lib/ReaderWriter/MachO/ArchHandler_x86.cpp index faabffaf5ca..9e036870b65 100644 --- a/lld/lib/ReaderWriter/MachO/ArchHandler_x86.cpp +++ b/lld/lib/ReaderWriter/MachO/ArchHandler_x86.cpp @@ -420,6 +420,11 @@ void ArchHandler_x86::generateAtomContent(const DefinedAtom &atom, FindAddressForAtom findSectionAddress, uint64_t imageBaseAddress, uint8_t *atomContentBuffer) { + if (!atom.size()) { + assert(atom.begin() == atom.end() && + "Cannot have references without content"); + return; + } // Copy raw bytes. memcpy(atomContentBuffer, atom.rawContent().data(), atom.size()); // Apply fix-ups. |