[llvm-commits] [compiler-rt] r161570 - in /compiler-rt/trunk/lib/asan: asan_interceptors.cc asan_report.cc asan_report.h
Alexey Samsonov
samsonov at google.com
Thu Aug 9 01:32:33 PDT 2012
Author: samsonov
Date: Thu Aug 9 03:32:33 2012
New Revision: 161570
URL: http://llvm.org/viewvc/llvm-project?rev=161570&view=rev
Log:
[ASan] Move error reporting code away from file with interceptors
Modified:
compiler-rt/trunk/lib/asan/asan_interceptors.cc
compiler-rt/trunk/lib/asan/asan_report.cc
compiler-rt/trunk/lib/asan/asan_report.h
Modified: compiler-rt/trunk/lib/asan/asan_interceptors.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_interceptors.cc?rev=161570&r1=161569&r2=161570&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/asan_interceptors.cc (original)
+++ compiler-rt/trunk/lib/asan/asan_interceptors.cc Thu Aug 9 03:32:33 2012
@@ -17,6 +17,7 @@
#include "asan_interface.h"
#include "asan_internal.h"
#include "asan_mapping.h"
+#include "asan_report.h"
#include "asan_stack.h"
#include "asan_stats.h"
#include "asan_thread_registry.h"
@@ -190,11 +191,9 @@
const char *offset1 = (const char*)_offset1; \
const char *offset2 = (const char*)_offset2; \
if (RangesOverlap(offset1, length1, offset2, length2)) { \
- AsanReport("ERROR: AddressSanitizer %s-param-overlap: " \
- "memory ranges [%p,%p) and [%p, %p) overlap\n", \
- name, offset1, offset1 + length1, offset2, offset2 + length2); \
- PRINT_CURRENT_STACK(); \
- ShowStatsAndAbort(); \
+ GET_STACK_TRACE_HERE(kStackTraceMax); \
+ ReportStringFunctionMemoryRangesOverlap(name, offset1, length1, \
+ offset2, length2, &stack); \
} \
} while (0)
Modified: compiler-rt/trunk/lib/asan/asan_report.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_report.cc?rev=161570&r1=161569&r2=161570&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/asan_report.cc (original)
+++ compiler-rt/trunk/lib/asan/asan_report.cc Thu Aug 9 03:32:33 2012
@@ -62,5 +62,14 @@
ShowStatsAndAbort();
}
+void ReportStringFunctionMemoryRangesOverlap(
+ const char *function, const char *offset1, uptr length1,
+ const char *offset2, uptr length2, AsanStackTrace *stack) {
+ AsanReport("ERROR: AddressSanitizer %s-param-overlap: "
+ "memory ranges [%p,%p) and [%p, %p) overlap\n", \
+ function, offset1, offset1 + length1, offset2, offset2 + length2);
+ stack->PrintStack();
+ ShowStatsAndAbort();
+}
} // namespace __asan
Modified: compiler-rt/trunk/lib/asan/asan_report.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_report.h?rev=161570&r1=161569&r2=161570&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/asan_report.h (original)
+++ compiler-rt/trunk/lib/asan/asan_report.h Thu Aug 9 03:32:33 2012
@@ -24,5 +24,8 @@
AsanStackTrace *stack);
void NORETURN ReportAsanGetAllocatedSizeNotOwned(uptr addr,
AsanStackTrace *stack);
+void NORETURN ReportStringFunctionMemoryRangesOverlap(
+ const char *function, const char *offset1, uptr length1,
+ const char *offset2, uptr length2, AsanStackTrace *stack);
} // namespace __asan
More information about the llvm-commits
mailing list