Fix a UBsan bot.
authorRui Ueyama <ruiu@google.com>
Thu, 28 Sep 2017 00:27:39 +0000 (00:27 +0000)
committerRui Ueyama <ruiu@google.com>
Thu, 28 Sep 2017 00:27:39 +0000 (00:27 +0000)
commit5908845a7e7c6db39e100246a3875f519f5d1f97
treee3fd1d0264b0fc423963d896b243bdb244c5cd86
parent64094f86212d6b81434cb7c26e965ff53f1e3fa0
Fix a UBsan bot.

If we do not initialize Prefix here, Prefix.data() returns a nullptr.
Later, it is passed to memcpy. memcpy's behavior is undefined if src (or
dst) is a nullptr even if a given size is 0. That's why this code
triggered UBsan.

llvm-svn: 314368
llvm/lib/Support/TarWriter.cpp