| 538 | } |
| 539 | |
| 540 | static void PrintLegend(InternalScopedString *str) { |
| 541 | str->AppendF( |
| 542 | "Shadow byte legend (one shadow byte represents %d " |
| 543 | "application bytes):\n", |
| 544 | (int)ASAN_SHADOW_GRANULARITY); |
| 545 | PrintShadowByte(str, " Addressable: ", 0); |
| 546 | str->AppendF(" Partially addressable: "); |
| 547 | for (u8 i = 1; i < ASAN_SHADOW_GRANULARITY; i++) |
| 548 | PrintShadowByte(str, "", i, " "); |
| 549 | str->AppendF("\n"); |
| 550 | PrintShadowByte(str, " Heap left redzone: ", |
| 551 | kAsanHeapLeftRedzoneMagic); |
| 552 | PrintShadowByte(str, " Freed heap region: ", kAsanHeapFreeMagic); |
| 553 | PrintShadowByte(str, " Stack left redzone: ", |
| 554 | kAsanStackLeftRedzoneMagic); |
| 555 | PrintShadowByte(str, " Stack mid redzone: ", |
| 556 | kAsanStackMidRedzoneMagic); |
| 557 | PrintShadowByte(str, " Stack right redzone: ", |
| 558 | kAsanStackRightRedzoneMagic); |
| 559 | PrintShadowByte(str, " Stack after return: ", |
| 560 | kAsanStackAfterReturnMagic); |
| 561 | PrintShadowByte(str, " Stack use after scope: ", |
| 562 | kAsanStackUseAfterScopeMagic); |
| 563 | PrintShadowByte(str, " Global redzone: ", kAsanGlobalRedzoneMagic); |
| 564 | PrintShadowByte(str, " Global init order: ", |
| 565 | kAsanInitializationOrderMagic); |
| 566 | PrintShadowByte(str, " Poisoned by user: ", |
| 567 | kAsanUserPoisonedMemoryMagic); |
| 568 | PrintShadowByte(str, " Container overflow: ", |
| 569 | kAsanContiguousContainerOOBMagic); |
| 570 | PrintShadowByte(str, " Array cookie: ", |
| 571 | kAsanArrayCookieMagic); |
| 572 | PrintShadowByte(str, " Intra object redzone: ", |
| 573 | kAsanIntraObjectRedzone); |
| 574 | PrintShadowByte(str, " ASan internal: ", kAsanInternalHeapMagic); |
| 575 | PrintShadowByte(str, " Left alloca redzone: ", kAsanAllocaLeftMagic); |
| 576 | PrintShadowByte(str, " Right alloca redzone: ", kAsanAllocaRightMagic); |
| 577 | } |
| 578 | |
| 579 | static void PrintShadowBytes(InternalScopedString *str, const char *before, |
| 580 | u8 *bytes, u8 *guilty, uptr n) { |
no test coverage detected