From 3f34cc74c2cf3fd5579cb2b8ddd7af5af82889ca Mon Sep 17 00:00:00 2001 From: Filipe Cabecinhas Date: Wed, 14 Sep 2016 07:37:14 +0000 Subject: [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 --- lib/asan/asan_errors.cc | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'lib/asan/asan_errors.cc') 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 -- cgit v1.2.3