diff options
| author | Vitaly Buka <vitalybuka@google.com> | 2019-09-12 02:20:36 +0000 |
|---|---|---|
| committer | Vitaly Buka <vitalybuka@google.com> | 2019-09-12 02:20:36 +0000 |
| commit | d2af368aee56abf77f4a6ca3fd57ebdb697c48f2 (patch) | |
| tree | 36057b4d4b1e3fd38d33027438c81834e88e100d /compiler-rt/lib/asan | |
| parent | 6e8c21857ecb49b282c2ee4df434f27469647e5e (diff) | |
| download | bcm5719-llvm-d2af368aee56abf77f4a6ca3fd57ebdb697c48f2.tar.gz bcm5719-llvm-d2af368aee56abf77f4a6ca3fd57ebdb697c48f2.zip | |
[compiler-rt] Remove some cpplint filters
llvm-svn: 371704
Diffstat (limited to 'compiler-rt/lib/asan')
| -rw-r--r-- | compiler-rt/lib/asan/asan_malloc_win.cpp | 9 | ||||
| -rw-r--r-- | compiler-rt/lib/asan/asan_report.cpp | 8 | ||||
| -rw-r--r-- | compiler-rt/lib/asan/asan_rtems.cpp | 4 | ||||
| -rw-r--r-- | compiler-rt/lib/asan/asan_scariness_score.h | 2 | ||||
| -rw-r--r-- | compiler-rt/lib/asan/asan_thread.cpp | 3 |
5 files changed, 16 insertions, 10 deletions
diff --git a/compiler-rt/lib/asan/asan_malloc_win.cpp b/compiler-rt/lib/asan/asan_malloc_win.cpp index 9d107bee84f..13c6f652119 100644 --- a/compiler-rt/lib/asan/asan_malloc_win.cpp +++ b/compiler-rt/lib/asan/asan_malloc_win.cpp @@ -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); diff --git a/compiler-rt/lib/asan/asan_report.cpp b/compiler-rt/lib/asan/asan_report.cpp index 5c16cb3e43f..2e6ce436d03 100644 --- a/compiler-rt/lib/asan/asan_report.cpp +++ b/compiler-rt/lib/asan/asan_report.cpp @@ -410,8 +410,12 @@ static bool IsInvalidPointerPair(uptr a1, uptr a2) { 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); diff --git a/compiler-rt/lib/asan/asan_rtems.cpp b/compiler-rt/lib/asan/asan_rtems.cpp index 360d5780a3f..ecd568c5981 100644 --- a/compiler-rt/lib/asan/asan_rtems.cpp +++ b/compiler-rt/lib/asan/asan_rtems.cpp @@ -181,11 +181,11 @@ static void ThreadStartHook(void *hook, uptr os_id) { 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. diff --git a/compiler-rt/lib/asan/asan_scariness_score.h b/compiler-rt/lib/asan/asan_scariness_score.h index 9e7ba47d82d..3932973c225 100644 --- a/compiler-rt/lib/asan/asan_scariness_score.h +++ b/compiler-rt/lib/asan/asan_scariness_score.h @@ -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 { diff --git a/compiler-rt/lib/asan/asan_thread.cpp b/compiler-rt/lib/asan/asan_thread.cpp index c75cdc2bbd0..6734d9a1668 100644 --- a/compiler-rt/lib/asan/asan_thread.cpp +++ b/compiler-rt/lib/asan/asan_thread.cpp @@ -367,8 +367,9 @@ uptr AsanThread::GetStackVariableShadowStart(uptr addr) { } 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); |

