]> granicus.if.org Git - llvm/commitdiff
Temporary workaround for msan false positive.
authorSam McCall <sam.mccall@gmail.com>
Thu, 2 Nov 2017 12:29:47 +0000 (12:29 +0000)
committerSam McCall <sam.mccall@gmail.com>
Thu, 2 Nov 2017 12:29:47 +0000 (12:29 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@317203 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Support/Unix/Threading.inc

index 34bc906b0585fed10521fee1ad629d5fc2949f85..7369cff8466cc0393567d637f42e1ecd0e26813a 100644 (file)
@@ -206,7 +206,7 @@ void llvm::get_thread_name(SmallVectorImpl<char> &Name) {
 #if (defined(__GLIBC__) && defined(_GNU_SOURCE)) || defined(__ANDROID__)
 #if HAVE_PTHREAD_GETNAME_NP
   constexpr uint32_t len = get_max_thread_name_length_impl();
-  char Buffer[len];
+  char Buffer[len] = {'\0'};  // FIXME: working around MSan false positive.
   if (0 == ::pthread_getname_np(::pthread_self(), Buffer, len))
     Name.append(Buffer, Buffer + strlen(Buffer));
 #endif