StringRef is not null terminated.

llvm-svn: 152388
This commit is contained in:
Michael J. Spencer 2012-03-09 05:27:20 +00:00
parent 9f91f958b1
commit b5ef4df359
1 changed files with 2 additions and 2 deletions

View File

@ -345,8 +345,8 @@ private:
if ( name.empty() )
return 0;
uint32_t result = _stringPool.size();
_stringPool.insert(_stringPool.end(), name.size()+1, 0);
strcpy(&_stringPool[result], name.data());
_stringPool.insert(_stringPool.end(), name.begin(), name.end());
_stringPool.push_back(0);
return result;
}