[compiler-rt] r200387 - [asan] increase the buffer size for printing asan legend, add a test for legend

Kostya Serebryany kcc at google.com
Wed Jan 29 03:12:10 PST 2014


Author: kcc
Date: Wed Jan 29 05:12:09 2014
New Revision: 200387

URL: http://llvm.org/viewvc/llvm-project?rev=200387&view=rev
Log:
[asan] increase the buffer size for printing asan legend, add a test for legend

Modified:
    compiler-rt/trunk/lib/asan/asan_report.cc
    compiler-rt/trunk/lib/asan/lit_tests/TestCases/use-after-free.cc

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=200387&r1=200386&r2=200387&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/asan_report.cc (original)
+++ compiler-rt/trunk/lib/asan/asan_report.cc Wed Jan 29 05:12:09 2014
@@ -153,7 +153,7 @@ static void PrintShadowMemoryForAddress(
   uptr shadow_addr = MemToShadow(addr);
   const uptr n_bytes_per_row = 16;
   uptr aligned_shadow = shadow_addr & ~(n_bytes_per_row - 1);
-  InternalScopedString str(4096);
+  InternalScopedString str(4096 * 8);
   str.append("Shadow bytes around the buggy address:\n");
   for (int i = -5; i <= 5; i++) {
     const char *prefix = (i == 0) ? "=>" : "  ";

Modified: compiler-rt/trunk/lib/asan/lit_tests/TestCases/use-after-free.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/lit_tests/TestCases/use-after-free.cc?rev=200387&r1=200386&r2=200387&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/lit_tests/TestCases/use-after-free.cc (original)
+++ compiler-rt/trunk/lib/asan/lit_tests/TestCases/use-after-free.cc Wed Jan 29 05:12:09 2014
@@ -28,4 +28,7 @@ int main() {
 
   // CHECK-Darwin: {{    #0 0x.* in wrap_malloc.*}}
   // CHECK-Darwin: {{    #1 0x.* in main .*use-after-free.cc:8}}
+  // CHECK: Shadow byte legend (one shadow byte represents 8 application bytes):
+  // CHECK: Global redzone:
+  // CHECK: ASan internal:
 }





More information about the llvm-commits mailing list