mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-04-02 15:51:54 +00:00
Fix off-by-one in set_thread_name which causes truncation to fail on Linux
llvm-svn: 325069
This commit is contained in:
parent
e6e2436fba
commit
41b574ca17
@ -138,8 +138,9 @@ void llvm::set_thread_name(const Twine &Name) {
|
||||
// terminated, but additionally the end of a long thread name will usually
|
||||
// be more unique than the beginning, since a common pattern is for similar
|
||||
// threads to share a common prefix.
|
||||
// Note that the name length includes the null terminator.
|
||||
if (get_max_thread_name_length() > 0)
|
||||
NameStr = NameStr.take_back(get_max_thread_name_length());
|
||||
NameStr = NameStr.take_back(get_max_thread_name_length() - 1);
|
||||
(void)NameStr;
|
||||
#if defined(__linux__)
|
||||
#if (defined(__GLIBC__) && defined(_GNU_SOURCE)) || defined(__ANDROID__)
|
||||
|
Loading…
x
Reference in New Issue
Block a user