Don't pass null to memcpy. Should fix the asan bots.

llvm-svn: 283336
This commit is contained in:
Rafael Espindola 2016-10-05 16:33:03 +00:00
parent 80af0b9e3c
commit 24db10d8e1
1 changed files with 2 additions and 1 deletions

View File

@ -79,7 +79,8 @@ void StringTableBuilder::write(uint8_t *Buf) const {
assert(isFinalized());
for (const StringPair &P : StringIndexMap) {
StringRef Data = P.first.val();
memcpy(Buf + P.second, Data.data(), Data.size());
if (!Data.empty())
memcpy(Buf + P.second, Data.data(), Data.size());
}
if (K != WinCOFF)
return;