diff options
author | Filipe Cabecinhas <me@filcab.net> | 2016-09-14 07:37:14 +0000 |
---|---|---|
committer | Filipe Cabecinhas <me@filcab.net> | 2016-09-14 07:37:14 +0000 |
commit | 3f34cc74c2cf3fd5579cb2b8ddd7af5af82889ca (patch) | |
tree | 905546d59f5ca41bdc5dda2117e3e99acf5d7c9a /lib/asan/asan_report.cc | |
parent | 73b166fd882b0e5b535f203c747da708445b93f7 (diff) | |
download | compiler-rt-3f34cc74c2cf3fd5579cb2b8ddd7af5af82889ca.tar.gz |
[asan] Reify ErrorStringFunctionMemoryRangesOverlap
Summary: Continuing implementation mentioned in this thread: http://lists.llvm.org/pipermail/llvm-dev/2016-July/101933.html
Reviewers: kcc, eugenis, vitalybuka
Subscribers: kubabrecka, llvm-commits
Differential Revision: https://reviews.llvm.org/D24393
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@281443 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/asan/asan_report.cc')
-rw-r--r-- | lib/asan/asan_report.cc | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/lib/asan/asan_report.cc b/lib/asan/asan_report.cc index 29ae230dc..4686a1901 100644 --- a/lib/asan/asan_report.cc +++ b/lib/asan/asan_report.cc @@ -382,19 +382,10 @@ void ReportStringFunctionMemoryRangesOverlap(const char *function, const char *offset2, uptr length2, BufferedStackTrace *stack) { ScopedInErrorReport in_report; - Decorator d; - char bug_type[100]; - internal_snprintf(bug_type, sizeof(bug_type), "%s-param-overlap", function); - Printf("%s", d.Warning()); - Report("ERROR: AddressSanitizer: %s: " - "memory ranges [%p,%p) and [%p, %p) overlap\n", \ - bug_type, offset1, offset1 + length1, offset2, offset2 + length2); - Printf("%s", d.EndWarning()); - ScarinessScore::PrintSimple(10, bug_type); - stack->Print(); - PrintAddressDescription((uptr)offset1, length1, bug_type); - PrintAddressDescription((uptr)offset2, length2, bug_type); - ReportErrorSummary(bug_type, stack); + ErrorStringFunctionMemoryRangesOverlap error( + GetCurrentTidOrInvalid(), stack, (uptr)offset1, length1, (uptr)offset2, + length2, function); + in_report.ReportError(error); } void ReportStringFunctionSizeOverflow(uptr offset, uptr size, |