[asan] increase the buffer size for printing asan legend, add a test for legend

llvm-svn: 200387
This commit is contained in:
Kostya Serebryany 2014-01-29 11:12:09 +00:00
parent cda06acd31
commit 336d97146a
2 changed files with 4 additions and 1 deletions

View File

@ -153,7 +153,7 @@ static void PrintShadowMemoryForAddress(uptr addr) {
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) ? "=>" : " ";

View File

@ -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:
}