summaryrefslogtreecommitdiff
path: root/lib/asan/asan_report.cc
diff options
context:
space:
mode:
authorFilipe Cabecinhas <me@filcab.net>2016-09-14 07:37:14 +0000
committerFilipe Cabecinhas <me@filcab.net>2016-09-14 07:37:14 +0000
commit3f34cc74c2cf3fd5579cb2b8ddd7af5af82889ca (patch)
tree905546d59f5ca41bdc5dda2117e3e99acf5d7c9a /lib/asan/asan_report.cc
parent73b166fd882b0e5b535f203c747da708445b93f7 (diff)
downloadcompiler-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.cc17
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,