[compiler-rt] r371704 - [compiler-rt] Remove some cpplint filters

Vitaly Buka via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 11 19:20:36 PDT 2019


Author: vitalybuka
Date: Wed Sep 11 19:20:36 2019
New Revision: 371704

URL: http://llvm.org/viewvc/llvm-project?rev=371704&view=rev
Log:
[compiler-rt] Remove some cpplint filters

Modified:
    compiler-rt/trunk/include/fuzzer/FuzzedDataProvider.h
    compiler-rt/trunk/lib/asan/asan_malloc_win.cpp
    compiler-rt/trunk/lib/asan/asan_report.cpp
    compiler-rt/trunk/lib/asan/asan_rtems.cpp
    compiler-rt/trunk/lib/asan/asan_scariness_score.h
    compiler-rt/trunk/lib/asan/asan_thread.cpp
    compiler-rt/trunk/lib/dfsan/dfsan.h
    compiler-rt/trunk/lib/dfsan/dfsan_custom.cpp
    compiler-rt/trunk/lib/interception/interception_win.cpp
    compiler-rt/trunk/lib/lsan/lsan_common.cpp
    compiler-rt/trunk/lib/msan/msan.h
    compiler-rt/trunk/lib/sanitizer_common/sanitizer_common_interceptors.inc
    compiler-rt/trunk/lib/sanitizer_common/sanitizer_flag_parser.cpp
    compiler-rt/trunk/lib/sanitizer_common/sanitizer_flag_parser.h
    compiler-rt/trunk/lib/sanitizer_common/sanitizer_interceptors_ioctl_netbsd.inc
    compiler-rt/trunk/lib/sanitizer_common/sanitizer_libc.cpp
    compiler-rt/trunk/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp
    compiler-rt/trunk/lib/sanitizer_common/sanitizer_symbolizer_report.cpp
    compiler-rt/trunk/lib/sanitizer_common/scripts/check_lint.sh
    compiler-rt/trunk/lib/sanitizer_common/tests/sanitizer_printf_test.cpp
    compiler-rt/trunk/lib/sanitizer_common/tests/sanitizer_suppressions_test.cpp
    compiler-rt/trunk/test/asan/TestCases/scariness_score_test.cpp

Modified: compiler-rt/trunk/include/fuzzer/FuzzedDataProvider.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/include/fuzzer/FuzzedDataProvider.h?rev=371704&r1=371703&r2=371704&view=diff
==============================================================================
--- compiler-rt/trunk/include/fuzzer/FuzzedDataProvider.h (original)
+++ compiler-rt/trunk/include/fuzzer/FuzzedDataProvider.h Wed Sep 11 19:20:36 2019
@@ -284,9 +284,9 @@ class FuzzedDataProvider {
 
     // Avoid using implementation-defined unsigned to signer conversions.
     // To learn more, see https://stackoverflow.com/questions/13150449.
-    if (value <= std::numeric_limits<TS>::max())
+    if (value <= std::numeric_limits<TS>::max()) {
       return static_cast<TS>(value);
-    else {
+    } else {
       constexpr auto TS_min = std::numeric_limits<TS>::min();
       return TS_min + static_cast<char>(value - TS_min);
     }

Modified: compiler-rt/trunk/lib/asan/asan_malloc_win.cpp
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_malloc_win.cpp?rev=371704&r1=371703&r2=371704&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/asan_malloc_win.cpp (original)
+++ compiler-rt/trunk/lib/asan/asan_malloc_win.cpp Wed Sep 11 19:20:36 2019
@@ -528,10 +528,11 @@ void ReplaceSystemMalloc() {
                                      (uptr)WRAP(RtlAllocateHeap),
                                      (uptr *)&REAL(RtlAllocateHeap));
   } else {
-#define INTERCEPT_UCRT_FUNCTION(func)                                         \
-  if (!INTERCEPT_FUNCTION_DLLIMPORT("ucrtbase.dll",                           \
-                                    "api-ms-win-core-heap-l1-1-0.dll", func)) \
-    VPrintf(2, "Failed to intercept ucrtbase.dll import %s\n", #func);
+#define INTERCEPT_UCRT_FUNCTION(func)                                  \
+  if (!INTERCEPT_FUNCTION_DLLIMPORT(                                   \
+          "ucrtbase.dll", "api-ms-win-core-heap-l1-1-0.dll", func)) {  \
+    VPrintf(2, "Failed to intercept ucrtbase.dll import %s\n", #func); \
+  }
     INTERCEPT_UCRT_FUNCTION(HeapAlloc);
     INTERCEPT_UCRT_FUNCTION(HeapFree);
     INTERCEPT_UCRT_FUNCTION(HeapReAlloc);

Modified: compiler-rt/trunk/lib/asan/asan_report.cpp
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_report.cpp?rev=371704&r1=371703&r2=371704&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/asan_report.cpp (original)
+++ compiler-rt/trunk/lib/asan/asan_report.cpp Wed Sep 11 19:20:36 2019
@@ -410,8 +410,12 @@ static bool IsInvalidPointerPair(uptr a1
 
 static INLINE void CheckForInvalidPointerPair(void *p1, void *p2) {
   switch (flags()->detect_invalid_pointer_pairs) {
-    case 0 : return;
-    case 1 : if (p1 == nullptr || p2 == nullptr) return; break;
+    case 0:
+      return;
+    case 1:
+      if (p1 == nullptr || p2 == nullptr)
+        return;
+      break;
   }
 
   uptr a1 = reinterpret_cast<uptr>(p1);

Modified: compiler-rt/trunk/lib/asan/asan_rtems.cpp
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_rtems.cpp?rev=371704&r1=371703&r2=371704&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/asan_rtems.cpp (original)
+++ compiler-rt/trunk/lib/asan/asan_rtems.cpp Wed Sep 11 19:20:36 2019
@@ -181,11 +181,11 @@ static void ThreadStartHook(void *hook,
       asanThreadRegistry().GetThreadLocked(thread->tid())->status;
   DCHECK(status == ThreadStatusCreated || status == ThreadStatusRunning);
   // Determine whether we are starting or restarting the thread.
-  if (status == ThreadStatusCreated)
+  if (status == ThreadStatusCreated) {
     // In lieu of AsanThread::ThreadStart.
     asanThreadRegistry().StartThread(thread->tid(), os_id, ThreadType::Regular,
                                      nullptr);
-  else {
+  } else {
     // In a thread restart, a thread may resume execution at an
     // arbitrary function entry point, with its stack and TLS state
     // reset.  We unpoison the stack in that case.

Modified: compiler-rt/trunk/lib/asan/asan_scariness_score.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_scariness_score.h?rev=371704&r1=371703&r2=371704&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/asan_scariness_score.h (original)
+++ compiler-rt/trunk/lib/asan/asan_scariness_score.h Wed Sep 11 19:20:36 2019
@@ -43,7 +43,7 @@ struct ScarinessScoreBase {
       internal_strlcat(descr, "-", sizeof(descr));
     internal_strlcat(descr, reason, sizeof(descr));
     score += add_to_score;
-  };
+  }
   int GetScore() const { return score; }
   const char *GetDescription() const { return descr; }
   void Print() const {

Modified: compiler-rt/trunk/lib/asan/asan_thread.cpp
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_thread.cpp?rev=371704&r1=371703&r2=371704&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/asan_thread.cpp (original)
+++ compiler-rt/trunk/lib/asan/asan_thread.cpp Wed Sep 11 19:20:36 2019
@@ -367,8 +367,9 @@ uptr AsanThread::GetStackVariableShadowS
   } else if (has_fake_stack()) {
     bottom = fake_stack()->AddrIsInFakeStack(addr);
     CHECK(bottom);
-  } else
+  } else {
     return 0;
+  }
 
   uptr aligned_addr = RoundDownTo(addr, SANITIZER_WORDSIZE / 8);  // align addr.
   u8 *shadow_ptr = (u8*)MemToShadow(aligned_addr);

Modified: compiler-rt/trunk/lib/dfsan/dfsan.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/dfsan/dfsan.h?rev=371704&r1=371703&r2=371704&view=diff
==============================================================================
--- compiler-rt/trunk/lib/dfsan/dfsan.h (original)
+++ compiler-rt/trunk/lib/dfsan/dfsan.h Wed Sep 11 19:20:36 2019
@@ -38,7 +38,7 @@ dfsan_label dfsan_union(dfsan_label l1,
 }  // extern "C"
 
 template <typename T>
-void dfsan_set_label(dfsan_label label, T &data) {
+void dfsan_set_label(dfsan_label label, T &data) {  // NOLINT
   dfsan_set_label(label, (void *)&data, sizeof(T));
 }
 

Modified: compiler-rt/trunk/lib/dfsan/dfsan_custom.cpp
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/dfsan/dfsan_custom.cpp?rev=371704&r1=371703&r2=371704&view=diff
==============================================================================
--- compiler-rt/trunk/lib/dfsan/dfsan_custom.cpp (original)
+++ compiler-rt/trunk/lib/dfsan/dfsan_custom.cpp Wed Sep 11 19:20:36 2019
@@ -505,7 +505,7 @@ int __dfsw_getrusage(int who, struct rus
 SANITIZER_INTERFACE_ATTRIBUTE
 char *__dfsw_strcpy(char *dest, const char *src, dfsan_label dst_label,
                     dfsan_label src_label, dfsan_label *ret_label) {
-  char *ret = strcpy(dest, src);
+  char *ret = strcpy(dest, src);  // NOLINT
   if (ret) {
     internal_memcpy(shadow_for(dest), shadow_for(src),
                     sizeof(dfsan_label) * (strlen(src) + 1));

Modified: compiler-rt/trunk/lib/interception/interception_win.cpp
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/interception/interception_win.cpp?rev=371704&r1=371703&r2=371704&view=diff
==============================================================================
--- compiler-rt/trunk/lib/interception/interception_win.cpp (original)
+++ compiler-rt/trunk/lib/interception/interception_win.cpp Wed Sep 11 19:20:36 2019
@@ -883,8 +883,8 @@ uptr InternalGetProcAddress(void *module
   // Check that the module header is full and present.
   RVAPtr<IMAGE_DOS_HEADER> dos_stub(module, 0);
   RVAPtr<IMAGE_NT_HEADERS> headers(module, dos_stub->e_lfanew);
-  if (!module || dos_stub->e_magic != IMAGE_DOS_SIGNATURE || // "MZ"
-      headers->Signature != IMAGE_NT_SIGNATURE ||           // "PE\0\0"
+  if (!module || dos_stub->e_magic != IMAGE_DOS_SIGNATURE ||  // "MZ"
+      headers->Signature != IMAGE_NT_SIGNATURE ||             // "PE\0\0"
       headers->FileHeader.SizeOfOptionalHeader <
           sizeof(IMAGE_OPTIONAL_HEADER)) {
     return 0;
@@ -963,8 +963,8 @@ bool OverrideImportedFunction(const char
   // Check that the module header is full and present.
   RVAPtr<IMAGE_DOS_HEADER> dos_stub(module, 0);
   RVAPtr<IMAGE_NT_HEADERS> headers(module, dos_stub->e_lfanew);
-  if (!module || dos_stub->e_magic != IMAGE_DOS_SIGNATURE || // "MZ"
-      headers->Signature != IMAGE_NT_SIGNATURE ||            // "PE\0\0"
+  if (!module || dos_stub->e_magic != IMAGE_DOS_SIGNATURE ||  // "MZ"
+      headers->Signature != IMAGE_NT_SIGNATURE ||             // "PE\0\0"
       headers->FileHeader.SizeOfOptionalHeader <
           sizeof(IMAGE_OPTIONAL_HEADER)) {
     return false;

Modified: compiler-rt/trunk/lib/lsan/lsan_common.cpp
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/lsan/lsan_common.cpp?rev=371704&r1=371703&r2=371704&view=diff
==============================================================================
--- compiler-rt/trunk/lib/lsan/lsan_common.cpp (original)
+++ compiler-rt/trunk/lib/lsan/lsan_common.cpp Wed Sep 11 19:20:36 2019
@@ -535,7 +535,7 @@ static void ReportIfNotSuspended(ThreadC
     if (i >= suspended_threads.size() || suspended_threads[i] != tctx->os_id)
       Report("Running thread %d was not suspended. False leaks are possible.\n",
              tctx->os_id);
-  };
+  }
 }
 
 static void ReportUnsuspendedThreads(

Modified: compiler-rt/trunk/lib/msan/msan.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/msan/msan.h?rev=371704&r1=371703&r2=371704&view=diff
==============================================================================
--- compiler-rt/trunk/lib/msan/msan.h (original)
+++ compiler-rt/trunk/lib/msan/msan.h Wed Sep 11 19:20:36 2019
@@ -346,10 +346,11 @@ const int STACK_TRACE_TAG_POISON = Stack
 #define GET_STORE_STACK_TRACE \
   GET_STORE_STACK_TRACE_PC_BP(StackTrace::GetCurrentPc(), GET_CURRENT_FRAME())
 
-#define GET_FATAL_STACK_TRACE_PC_BP(pc, bp)              \
-  BufferedStackTrace stack;                              \
-  if (msan_inited)                                       \
-    stack.Unwind(pc, bp, nullptr, common_flags()->fast_unwind_on_fatal)
+#define GET_FATAL_STACK_TRACE_PC_BP(pc, bp)                              \
+  BufferedStackTrace stack;                                              \
+  if (msan_inited) {                                                     \
+    stack.Unwind(pc, bp, nullptr, common_flags()->fast_unwind_on_fatal); \
+  }
 
 #define GET_FATAL_STACK_TRACE_HERE \
   GET_FATAL_STACK_TRACE_PC_BP(StackTrace::GetCurrentPc(), GET_CURRENT_FRAME())

Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_common_interceptors.inc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_common_interceptors.inc?rev=371704&r1=371703&r2=371704&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_common_interceptors.inc (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_common_interceptors.inc Wed Sep 11 19:20:36 2019
@@ -3070,13 +3070,14 @@ INTERCEPTOR(int, sendmmsg, int fd, struc
     COMMON_INTERCEPTOR_FD_RELEASE(ctx, fd);
   }
   int res = REAL(sendmmsg)(fd, msgvec, vlen, flags);
-  if (res >= 0 && msgvec)
+  if (res >= 0 && msgvec) {
     for (int i = 0; i < res; ++i) {
       COMMON_INTERCEPTOR_WRITE_RANGE(ctx, &msgvec[i].msg_len,
                                      sizeof(msgvec[i].msg_len));
       if (common_flags()->intercept_send)
         read_msghdr(ctx, &msgvec[i].msg_hdr, msgvec[i].msg_len);
     }
+  }
   return res;
 }
 #define INIT_SENDMMSG COMMON_INTERCEPT_FUNCTION(sendmmsg);
@@ -3207,20 +3208,21 @@ INTERCEPTOR(uptr, ptrace, int request, i
   __sanitizer_iovec local_iovec;
 
   if (data) {
-    if (request == ptrace_setregs)
+    if (request == ptrace_setregs) {
       COMMON_INTERCEPTOR_READ_RANGE(ctx, data, struct_user_regs_struct_sz);
-    else if (request == ptrace_setfpregs)
+    } else if (request == ptrace_setfpregs) {
       COMMON_INTERCEPTOR_READ_RANGE(ctx, data, struct_user_fpregs_struct_sz);
-    else if (request == ptrace_setfpxregs)
+    } else if (request == ptrace_setfpxregs) {
       COMMON_INTERCEPTOR_READ_RANGE(ctx, data, struct_user_fpxregs_struct_sz);
-    else if (request == ptrace_setvfpregs)
+    } else if (request == ptrace_setvfpregs) {
       COMMON_INTERCEPTOR_READ_RANGE(ctx, data, struct_user_vfpregs_struct_sz);
-    else if (request == ptrace_setsiginfo)
+    } else if (request == ptrace_setsiginfo) {
       COMMON_INTERCEPTOR_READ_RANGE(ctx, data, siginfo_t_sz);
+
     // Some kernel might zero the iovec::iov_base in case of invalid
     // write access.  In this case copy the invalid address for further
     // inspection.
-    else if (request == ptrace_setregset || request == ptrace_getregset) {
+    } else if (request == ptrace_setregset || request == ptrace_getregset) {
       __sanitizer_iovec *iovec = (__sanitizer_iovec*)data;
       COMMON_INTERCEPTOR_READ_RANGE(ctx, iovec, sizeof(*iovec));
       local_iovec = *iovec;
@@ -3237,19 +3239,19 @@ INTERCEPTOR(uptr, ptrace, int request, i
   if (!res && data) {
     // Note that PEEK* requests assign different meaning to the return value.
     // This function does not handle them (nor does it need to).
-    if (request == ptrace_getregs)
+    if (request == ptrace_getregs) {
       COMMON_INTERCEPTOR_WRITE_RANGE(ctx, data, struct_user_regs_struct_sz);
-    else if (request == ptrace_getfpregs)
+    } else if (request == ptrace_getfpregs) {
       COMMON_INTERCEPTOR_WRITE_RANGE(ctx, data, struct_user_fpregs_struct_sz);
-    else if (request == ptrace_getfpxregs)
+    } else if (request == ptrace_getfpxregs) {
       COMMON_INTERCEPTOR_WRITE_RANGE(ctx, data, struct_user_fpxregs_struct_sz);
-    else if (request == ptrace_getvfpregs)
+    } else if (request == ptrace_getvfpregs) {
       COMMON_INTERCEPTOR_WRITE_RANGE(ctx, data, struct_user_vfpregs_struct_sz);
-    else if (request == ptrace_getsiginfo)
+    } else if (request == ptrace_getsiginfo) {
       COMMON_INTERCEPTOR_WRITE_RANGE(ctx, data, siginfo_t_sz);
-    else if (request == ptrace_geteventmsg)
+    } else if (request == ptrace_geteventmsg) {
       COMMON_INTERCEPTOR_WRITE_RANGE(ctx, data, sizeof(unsigned long));
-    else if (request == ptrace_getregset) {
+    } else if (request == ptrace_getregset) {
       __sanitizer_iovec *iovec = (__sanitizer_iovec*)data;
       COMMON_INTERCEPTOR_WRITE_RANGE(ctx, iovec, sizeof(*iovec));
       COMMON_INTERCEPTOR_WRITE_RANGE(ctx, local_iovec.iov_base,
@@ -7842,10 +7844,11 @@ INTERCEPTOR(int, modctl, int operation,
     if (iov)
       COMMON_INTERCEPTOR_WRITE_RANGE(
           ctx, iov->iov_base, Min(iov_len,  iov->iov_len));
-  } else if (operation == modctl_exists)
+  } else if (operation == modctl_exists) {
     ret = REAL(modctl)(operation, argp);
-  else
+  } else {
     ret = REAL(modctl)(operation, argp);
+  }
 
   return ret;
 }

Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_flag_parser.cpp
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_flag_parser.cpp?rev=371704&r1=371703&r2=371704&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_flag_parser.cpp (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_flag_parser.cpp Wed Sep 11 19:20:36 2019
@@ -83,8 +83,9 @@ void FlagParser::parse_flag(const char *
       Printf("%s: ERROR: expected '=' in %s\n", SanitizerToolName,
              env_option_name);
       Die();
-    } else
+    } else {
       fatal_error("expected '='");
+    }
   }
   char *name = ll_strndup(buf_ + name_start, pos_ - name_start);
 

Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_flag_parser.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_flag_parser.h?rev=371704&r1=371703&r2=371704&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_flag_parser.h (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_flag_parser.h Wed Sep 11 19:20:36 2019
@@ -24,7 +24,7 @@ class FlagHandlerBase {
   virtual bool Parse(const char *value) { return false; }
 
  protected:
-  ~FlagHandlerBase() {};
+  ~FlagHandlerBase() {}
 };
 
 template <typename T>

Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_interceptors_ioctl_netbsd.inc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_interceptors_ioctl_netbsd.inc?rev=371704&r1=371703&r2=371704&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_interceptors_ioctl_netbsd.inc (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_interceptors_ioctl_netbsd.inc Wed Sep 11 19:20:36 2019
@@ -1404,7 +1404,7 @@ static void ioctl_table_fill() {
   _(SNDCTL_DSP_SKIP, NONE, 0);
   _(SNDCTL_DSP_SILENCE, NONE, 0);
 #undef _
-}
+}  // NOLINT
 
 static bool ioctl_initialized = false;
 

Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_libc.cpp
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_libc.cpp?rev=371704&r1=371703&r2=371704&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_libc.cpp (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_libc.cpp Wed Sep 11 19:20:36 2019
@@ -63,10 +63,11 @@ void *internal_memmove(void *dest, const
     for (i = 0; i < signed_n; ++i)
       d[i] = s[i];
   } else {
-    if (d > s && signed_n > 0)
-      for (i = signed_n - 1; i >= 0 ; --i) {
+    if (d > s && signed_n > 0) {
+      for (i = signed_n - 1; i >= 0; --i) {
         d[i] = s[i];
       }
+    }
   }
   return dest;
 }
@@ -270,9 +271,9 @@ bool mem_is_zero(const char *beg, uptr s
   for (; aligned_beg < aligned_end; aligned_beg++)
     all |= *aligned_beg;
   // Epilogue.
-  if ((char*)aligned_end >= beg)
-    for (const char *mem = (char*)aligned_end; mem < end; mem++)
-      all |= *mem;
+  if ((char *)aligned_end >= beg) {
+    for (const char *mem = (char *)aligned_end; mem < end; mem++) all |= *mem;
+  }
   return all == 0;
 }
 

Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp?rev=371704&r1=371703&r2=371704&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp Wed Sep 11 19:20:36 2019
@@ -223,10 +223,11 @@ bool ThreadSuspender::SuspendAllThreads(
       case ThreadLister::Ok:
         break;
     }
-    for (tid_t tid : threads)
+    for (tid_t tid : threads) {
       if (SuspendThread(tid))
         retry = true;
-  };
+    }
+  }
   return suspended_threads_list_.ThreadCount();
 }
 

Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_symbolizer_report.cpp
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_symbolizer_report.cpp?rev=371704&r1=371703&r2=371704&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_symbolizer_report.cpp (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_symbolizer_report.cpp Wed Sep 11 19:20:36 2019
@@ -106,8 +106,9 @@ void ReportMmapWriteExec(int prot) {
   if (StackTrace::WillUseFastUnwind(fast)) {
     GetThreadStackTopAndBottom(false, &top, &bottom);
     stack->Unwind(kStackTraceMax, pc, bp, nullptr, top, bottom, true);
-  } else
+  } else {
     stack->Unwind(kStackTraceMax, pc, 0, nullptr, 0, 0, false);
+  }
 
   Printf("%s", d.Warning());
   Report("WARNING: %s: writable-executable page usage\n", SanitizerToolName);

Modified: compiler-rt/trunk/lib/sanitizer_common/scripts/check_lint.sh
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/scripts/check_lint.sh?rev=371704&r1=371703&r2=371704&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/scripts/check_lint.sh (original)
+++ compiler-rt/trunk/lib/sanitizer_common/scripts/check_lint.sh Wed Sep 11 19:20:36 2019
@@ -17,15 +17,15 @@ fi
 # Filters
 # TODO: remove some of these filters
 COMMON_LINT_FILTER=-build/include,-build/header_guard,-legal/copyright,-whitespace/comments,-readability/casting,\
--build/namespaces,-readability/braces,-build/c++11,-runtime/int
+-build/namespaces,-build/c++11,-runtime/int
 
 COMMON_LIT_TEST_LINT_FILTER=-whitespace/indent,-whitespace/line_length,-runtime/arrays
 
 ASAN_RTL_LINT_FILTER=${COMMON_LINT_FILTER}
-ASAN_TEST_LINT_FILTER=${COMMON_LINT_FILTER},-runtime/sizeof,-runtime/printf,-runtime/threadsafe_fn
+ASAN_TEST_LINT_FILTER=${COMMON_LINT_FILTER},-runtime/printf,-runtime/threadsafe_fn
 ASAN_LIT_TEST_LINT_FILTER=${ASAN_TEST_LINT_FILTER},${COMMON_LIT_TEST_LINT_FILTER}
 
-TSAN_RTL_LINT_FILTER=${COMMON_LINT_FILTER}
+TSAN_RTL_LINT_FILTER=${COMMON_LINT_FILTER},-readability/braces
 TSAN_TEST_LINT_FILTER=${TSAN_RTL_LINT_FILTER},-runtime/threadsafe_fn
 TSAN_LIT_TEST_LINT_FILTER=${TSAN_TEST_LINT_FILTER},${COMMON_LIT_TEST_LINT_FILTER}
 
@@ -34,10 +34,10 @@ MSAN_RTL_LINT_FILTER=${COMMON_LINT_FILTE
 LSAN_RTL_LINT_FILTER=${COMMON_LINT_FILTER}
 LSAN_LIT_TEST_LINT_FILTER=${LSAN_RTL_LINT_FILTER},${COMMON_LIT_TEST_LINT_FILTER}
 
-DFSAN_RTL_LINT_FILTER=${COMMON_LINT_FILTER},-runtime/printf,-runtime/references,-readability/function
+DFSAN_RTL_LINT_FILTER=${COMMON_LINT_FILTER}
 SCUDO_RTL_LINT_FILTER=${COMMON_LINT_FILTER}
 
-COMMON_RTL_INC_LINT_FILTER=${COMMON_LINT_FILTER},-runtime/sizeof,-runtime/printf,-readability/fn_size
+COMMON_RTL_INC_LINT_FILTER=${COMMON_LINT_FILTER}
 
 SANITIZER_INCLUDES_LINT_FILTER=${COMMON_LINT_FILTER}
 

Modified: compiler-rt/trunk/lib/sanitizer_common/tests/sanitizer_printf_test.cpp
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/tests/sanitizer_printf_test.cpp?rev=371704&r1=371703&r2=371704&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/tests/sanitizer_printf_test.cpp (original)
+++ compiler-rt/trunk/lib/sanitizer_common/tests/sanitizer_printf_test.cpp Wed Sep 11 19:20:36 2019
@@ -33,7 +33,7 @@ TEST(Printf, Basic) {
 
 TEST(Printf, OverflowStr) {
   char buf[] = "123456789";
-  uptr len = internal_snprintf(buf, 4, "%s", "abcdef");
+  uptr len = internal_snprintf(buf, 4, "%s", "abcdef");  // NOLINT
   EXPECT_EQ(len, (uptr)6);
   EXPECT_STREQ("abc", buf);
   EXPECT_EQ(buf[3], 0);
@@ -47,7 +47,7 @@ TEST(Printf, OverflowStr) {
 
 TEST(Printf, OverflowInt) {
   char buf[] = "123456789";
-  internal_snprintf(buf, 4, "%d", -123456789);
+  internal_snprintf(buf, 4, "%d", -123456789);  // NOLINT
   EXPECT_STREQ("-12", buf);
   EXPECT_EQ(buf[3], 0);
   EXPECT_EQ(buf[4], '5');
@@ -66,7 +66,7 @@ TEST(Printf, OverflowUint) {
   } else {
     val = (uptr)0x123456789ULL;
   }
-  internal_snprintf(buf, 4, "a%zx", val);
+  internal_snprintf(buf, 4, "a%zx", val);  // NOLINT
   EXPECT_STREQ("a12", buf);
   EXPECT_EQ(buf[3], 0);
   EXPECT_EQ(buf[4], '5');
@@ -85,7 +85,7 @@ TEST(Printf, OverflowPtr) {
   } else {
     p = (void*)0x123456789ULL;
   }
-  internal_snprintf(buf, 4, "%p", p);
+  internal_snprintf(buf, 4, "%p", p);  // NOLINT
   EXPECT_STREQ("0x0", buf);
   EXPECT_EQ(buf[3], 0);
   EXPECT_EQ(buf[4], '5');
@@ -149,7 +149,7 @@ TEST(Printf, Precision) {
   EXPECT_STREQ("12345 ", buf);
   // Check that width does not overflow the smaller buffer, although
   // 10 chars is requested, it stops at the buffer size, 8.
-  len = internal_snprintf(buf, 8, "%-10s", "12345");
+  len = internal_snprintf(buf, 8, "%-10s", "12345");  // NOLINT
   EXPECT_EQ(10U, len);  // The required size reported.
   EXPECT_STREQ("12345  ", buf);
 }

Modified: compiler-rt/trunk/lib/sanitizer_common/tests/sanitizer_suppressions_test.cpp
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/tests/sanitizer_suppressions_test.cpp?rev=371704&r1=371703&r2=371704&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/tests/sanitizer_suppressions_test.cpp (original)
+++ compiler-rt/trunk/lib/sanitizer_common/tests/sanitizer_suppressions_test.cpp Wed Sep 11 19:20:36 2019
@@ -18,7 +18,7 @@ namespace __sanitizer {
 
 static bool MyMatch(const char *templ, const char *func) {
   char tmp[1024];
-  strcpy(tmp, templ);
+  snprintf(tmp, sizeof(tmp), "%s", templ);
   return TemplateMatch(tmp, func);
 }
 

Modified: compiler-rt/trunk/test/asan/TestCases/scariness_score_test.cpp
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/asan/TestCases/scariness_score_test.cpp?rev=371704&r1=371703&r2=371704&view=diff
==============================================================================
--- compiler-rt/trunk/test/asan/TestCases/scariness_score_test.cpp (original)
+++ compiler-rt/trunk/test/asan/TestCases/scariness_score_test.cpp Wed Sep 11 19:20:36 2019
@@ -155,9 +155,9 @@ int main(int argc, char **argv) {
     case 10: StackBufferOverflow<char>(0, Write); break;
     case 11: StackBufferOverflow<int64_t>(0, Read); break;
     case 12:
-      if (scale <= 3)
+      if (scale <= 3) {
         StackBufferOverflow<int>(16, Write);
-      else {
+      } else {
         // At large shadow granularity, there is not enough redzone
         // between stack elements to detect far-from-bounds.  Pretend
         // that this test passes.




More information about the llvm-commits mailing list