Fix -Wcast-qual warning.

llvm-svn: 231139
This commit is contained in:
Rui Ueyama 2015-03-03 21:38:38 +00:00
parent d9ca757ed8
commit 82ca5e72d2
1 changed files with 1 additions and 1 deletions

View File

@ -1049,7 +1049,7 @@ StringRef FileCOFF::ArrayRefToString(ArrayRef<uint8_t> array) {
}
if (array.empty())
return "";
StringRef s((char *)array.data(), array.size());
StringRef s(reinterpret_cast<const char *>(array.data()), array.size());
s = s.substr(0, s.find_first_of('\0'));
std::string *contents = new (_alloc) std::string(s.data(), s.size());
return StringRef(*contents).trim();