From 170a8c12843db3dc10b544c0fc5b3f19566ee940 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Wed, 28 Jul 2021 19:58:52 +0200 Subject: [PATCH] sanitizer_common: avoid compiler-interted memset in deadlock detector Compilers tends to insert memset/memcpy for some struct/array operations, and these don't play well inside of sanitizer runtimes. Avoiding these calls was the intention behind internal_memset. Remove the leftover ={} that can result in memset call. Reviewed By: vitalybuka, pgousseau Differential Revision: https://reviews.llvm.org/D106978 --- compiler-rt/lib/sanitizer_common/sanitizer_mutex.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_mutex.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_mutex.cpp index 46f1d0279ca1..1c177d8e7cca 100644 --- a/compiler-rt/lib/sanitizer_common/sanitizer_mutex.cpp +++ b/compiler-rt/lib/sanitizer_common/sanitizer_mutex.cpp @@ -73,7 +73,7 @@ void DebugMutexInit() { // Build adjacency matrix. bool leaf[kMutexTypeMax]; internal_memset(&leaf, 0, sizeof(leaf)); - int cnt[kMutexTypeMax] = {}; + int cnt[kMutexTypeMax]; internal_memset(&cnt, 0, sizeof(cnt)); for (int t = 0; t < kMutexTypeMax; t++) { mutex_type_count = t;