summaryrefslogtreecommitdiff
path: root/lib/asan/asan_errors.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_errors.cc
parent73b166fd882b0e5b535f203c747da708445b93f7 (diff)
[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_errors.cc')
-rw-r--r--lib/asan/asan_errors.cc19
1 files changed, 19 insertions, 0 deletions
diff --git a/lib/asan/asan_errors.cc b/lib/asan/asan_errors.cc
index 418a20012..78d734e21 100644
--- a/lib/asan/asan_errors.cc
+++ b/lib/asan/asan_errors.cc
@@ -190,4 +190,23 @@ void ErrorSanitizerGetAllocatedSizeNotOwned::Print() {
ReportErrorSummary("bad-__sanitizer_get_allocated_size", stack);
}
+void ErrorStringFunctionMemoryRangesOverlap::Print() {
+ 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, addr1_description.Address(),
+ addr1_description.Address() + length1, addr2_description.Address(),
+ addr2_description.Address() + length2);
+ Printf("%s", d.EndWarning());
+ scariness.Print();
+ stack->Print();
+ addr1_description.Print();
+ addr2_description.Print();
+ ReportErrorSummary(bug_type, stack);
+}
+
} // namespace __asan