Avoid memcpy from nullptr. NFC.
authorPete Cooper <peter_cooper@apple.com>
Tue, 22 Mar 2016 22:59:35 +0000 (22:59 +0000)
committerPete Cooper <peter_cooper@apple.com>
Tue, 22 Mar 2016 22:59:35 +0000 (22:59 +0000)
commitb9a9d7163f984123875a8c6276a1567fe79bd29f
tree478802532cc5ab9572df69725f99e4908d914c25
parent8e1b9a17a692d428eeb16c0189ccbbaa741b366d
Avoid memcpy from nullptr.  NFC.

This was caught by the UBSan bot.  When the atom has no size, we would
issue a memcpy with size0 and a nullptr for the source.

Also, this code should never have references inside an empty atom so
add an assert for that while we're here.

llvm-svn: 264115
lld/lib/ReaderWriter/MachO/ArchHandler_x86.cpp