diff options
author | Evgeniy Stepanov <eugeni.stepanov@gmail.com> | 2018-11-09 00:03:39 +0000 |
---|---|---|
committer | Evgeniy Stepanov <eugeni.stepanov@gmail.com> | 2018-11-09 00:03:39 +0000 |
commit | 4680386c34ab5475d3ea5fdeca2735f36c8b9112 (patch) | |
tree | 3d63c18bb702d84290452fa9f62ce56a95094d14 | |
parent | b50daf7a21d2d608d704a47856a5b0ca3060b4c2 (diff) | |
download | bcm5719-llvm-4680386c34ab5475d3ea5fdeca2735f36c8b9112.tar.gz bcm5719-llvm-4680386c34ab5475d3ea5fdeca2735f36c8b9112.zip |
[hwasan] Remove dead code.
llvm-svn: 346452
-rw-r--r-- | compiler-rt/lib/hwasan/hwasan.cc | 5 | ||||
-rw-r--r-- | compiler-rt/lib/hwasan/hwasan.h | 2 | ||||
-rw-r--r-- | compiler-rt/lib/hwasan/hwasan_interceptors.cc | 36 | ||||
-rw-r--r-- | compiler-rt/lib/hwasan/hwasan_report.cc | 28 | ||||
-rw-r--r-- | compiler-rt/lib/hwasan/hwasan_report.h | 3 |
5 files changed, 0 insertions, 74 deletions
diff --git a/compiler-rt/lib/hwasan/hwasan.cc b/compiler-rt/lib/hwasan/hwasan.cc index 7febaf76049..8f0daeeb147 100644 --- a/compiler-rt/lib/hwasan/hwasan.cc +++ b/compiler-rt/lib/hwasan/hwasan.cc @@ -159,11 +159,6 @@ void GetStackTrace(BufferedStackTrace *stack, uptr max_s, uptr pc, uptr bp, request_fast_unwind); } -void PrintWarning(uptr pc, uptr bp) { - GET_FATAL_STACK_TRACE_PC_BP(pc, bp); - ReportInvalidAccess(&stack, 0); -} - static void HWAsanCheckFailed(const char *file, int line, const char *cond, u64 v1, u64 v2) { Report("HWAddressSanitizer CHECK failed: %s:%d \"%s\" (0x%zx, 0x%zx)\n", file, diff --git a/compiler-rt/lib/hwasan/hwasan.h b/compiler-rt/lib/hwasan/hwasan.h index 2fbc87cfe74..daf65eefd3a 100644 --- a/compiler-rt/lib/hwasan/hwasan.h +++ b/compiler-rt/lib/hwasan/hwasan.h @@ -104,8 +104,6 @@ struct SymbolizerScope { ~SymbolizerScope() { ExitSymbolizer(); } }; -void PrintWarning(uptr pc, uptr bp); - void GetStackTrace(BufferedStackTrace *stack, uptr max_s, uptr pc, uptr bp, void *context, bool request_fast_unwind); diff --git a/compiler-rt/lib/hwasan/hwasan_interceptors.cc b/compiler-rt/lib/hwasan/hwasan_interceptors.cc index fed4003de35..d20bdd95ad3 100644 --- a/compiler-rt/lib/hwasan/hwasan_interceptors.cc +++ b/compiler-rt/lib/hwasan/hwasan_interceptors.cc @@ -92,42 +92,6 @@ static void *AllocateFromLocalPool(uptr size_in_bytes) { } while (0) - -#define HWASAN_READ_RANGE(ctx, offset, size) \ - CHECK_UNPOISONED(offset, size) -#define HWASAN_WRITE_RANGE(ctx, offset, size) \ - CHECK_UNPOISONED(offset, size) - - - -// Check that [x, x+n) range is unpoisoned. -#define CHECK_UNPOISONED_0(x, n) \ - do { \ - sptr __offset = __hwasan_test_shadow(x, n); \ - if (__hwasan::IsInSymbolizer()) break; \ - if (__offset >= 0) { \ - GET_CALLER_PC_BP_SP; \ - (void)sp; \ - ReportInvalidAccessInsideAddressRange(__func__, x, n, __offset); \ - __hwasan::PrintWarning(pc, bp); \ - if (__hwasan::flags()->halt_on_error) { \ - Printf("Exiting\n"); \ - Die(); \ - } \ - } \ - } while (0) - -// Check that [x, x+n) range is unpoisoned unless we are in a nested -// interceptor. -#define CHECK_UNPOISONED(x, n) \ - do { \ - if (!IsInInterceptorScope()) CHECK_UNPOISONED_0(x, n); \ - } while (0) - -#define CHECK_UNPOISONED_STRING_OF_LEN(x, len, n) \ - CHECK_UNPOISONED((x), \ - common_flags()->strict_string_checks ? (len) + 1 : (n) ) - int __sanitizer_posix_memalign(void **memptr, uptr alignment, uptr size) { GET_MALLOC_STACK_TRACE; CHECK_NE(memptr, 0); diff --git a/compiler-rt/lib/hwasan/hwasan_report.cc b/compiler-rt/lib/hwasan/hwasan_report.cc index 57bd8278e5c..ef2d57a7bcf 100644 --- a/compiler-rt/lib/hwasan/hwasan_report.cc +++ b/compiler-rt/lib/hwasan/hwasan_report.cc @@ -228,36 +228,8 @@ void PrintAddressDescription( Printf("HWAddressSanitizer can not describe address in more detail.\n"); } -void ReportInvalidAccess(StackTrace *stack, u32 origin) { - ScopedErrorReportLock l; - - Decorator d; - Printf("%s", d.Warning()); - Report("WARNING: HWAddressSanitizer: invalid access\n"); - Printf("%s", d.Default()); - stack->Print(); - ReportErrorSummary("invalid-access", stack); -} - void ReportStats() {} -void ReportInvalidAccessInsideAddressRange(const char *what, const void *start, - uptr size, uptr offset) { - ScopedErrorReportLock l; - SavedStackAllocations current_stack_allocations( - GetCurrentThread()->stack_allocations()); - - Decorator d; - Printf("%s", d.Warning()); - Printf("%sTag mismatch in %s%s%s at offset %zu inside [%p, %zu)%s\n", - d.Warning(), d.Name(), what, d.Warning(), offset, start, size, - d.Default()); - PrintAddressDescription((uptr)start + offset, 1, - current_stack_allocations.get()); - // if (__sanitizer::Verbosity()) - // DescribeMemoryRange(start, size); -} - static void PrintTagsAroundAddr(tag_t *tag_ptr) { Printf( "Memory tags around the buggy address (one tag corresponds to %zd " diff --git a/compiler-rt/lib/hwasan/hwasan_report.h b/compiler-rt/lib/hwasan/hwasan_report.h index 7a9eec83479..85d00038386 100644 --- a/compiler-rt/lib/hwasan/hwasan_report.h +++ b/compiler-rt/lib/hwasan/hwasan_report.h @@ -21,10 +21,7 @@ namespace __hwasan { -void ReportInvalidAccess(StackTrace *stack, u32 origin); void ReportStats(); -void ReportInvalidAccessInsideAddressRange(const char *what, const void *start, - uptr size, uptr offset); void ReportTagMismatch(StackTrace *stack, uptr addr, uptr access_size, bool is_store); void ReportInvalidFree(StackTrace *stack, uptr addr); |