Skip to content
This repository was archived by the owner on Mar 28, 2020. It is now read-only.

Commit b53fb3c

Browse files
committed
Don't pass null to memcpy. Should fix the asan bots.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283336 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent e16f30e commit b53fb3c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/MC/StringTableBuilder.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,8 @@ void StringTableBuilder::write(uint8_t *Buf) const {
7979
assert(isFinalized());
8080
for (const StringPair &P : StringIndexMap) {
8181
StringRef Data = P.first.val();
82-
memcpy(Buf + P.second, Data.data(), Data.size());
82+
if (!Data.empty())
83+
memcpy(Buf + P.second, Data.data(), Data.size());
8384
}
8485
if (K != WinCOFF)
8586
return;

0 commit comments

Comments
 (0)