@@ -450,6 +450,7 @@ class BaseReport {
450
450
OverflowCandidate FindBufferOverflowCandidate () const ;
451
451
void PrintAddressDescription () const ;
452
452
void PrintHeapOrGlobalCandidate () const ;
453
+ void PrintTags (uptr addr) const ;
453
454
454
455
SavedStackAllocations stack_allocations_storage[16 ];
455
456
HeapAllocation heap_allocations_storage[256 ];
@@ -765,6 +766,14 @@ void BaseReport::PrintAddressDescription() const {
765
766
}
766
767
}
767
768
769
+ void BaseReport::PrintTags (uptr addr) const {
770
+ if (shadow.addr ) {
771
+ PrintTagsAroundAddr (
772
+ addr, [&](uptr addr) { return GetTagCopy (addr); },
773
+ [&](uptr addr) { return GetShortTagCopy (addr); });
774
+ }
775
+ }
776
+
768
777
class InvalidFreeReport : public BaseReport {
769
778
public:
770
779
InvalidFreeReport (StackTrace *stack, uptr tagged_addr)
@@ -797,13 +806,7 @@ InvalidFreeReport::~InvalidFreeReport() {
797
806
stack->Print ();
798
807
799
808
PrintAddressDescription ();
800
-
801
- if (shadow.addr ) {
802
- PrintTagsAroundAddr (
803
- untagged_addr, [&](uptr addr) { return GetTagCopy (addr); },
804
- [&](uptr addr) { return GetShortTagCopy (addr); });
805
- }
806
-
809
+ PrintTags (untagged_addr);
807
810
MaybePrintAndroidHelpUrl ();
808
811
ReportErrorSummary (bug_type, stack);
809
812
}
@@ -883,11 +886,7 @@ TailOverwrittenReport::~TailOverwrittenReport() {
883
886
kShadowAlignment , SanitizerToolName);
884
887
Printf (" %s" , s.data ());
885
888
GetCurrentThread ()->Announce ();
886
-
887
- PrintTagsAroundAddr (
888
- untagged_addr, [&](uptr addr) { return GetTagCopy (addr); },
889
- [&](uptr addr) { return GetShortTagCopy (addr); });
890
-
889
+ PrintTags (untagged_addr);
891
890
MaybePrintAndroidHelpUrl ();
892
891
ReportErrorSummary (bug_type, stack);
893
892
}
@@ -963,9 +962,7 @@ TagMismatchReport::~TagMismatchReport() {
963
962
PrintAddressDescription ();
964
963
t->Announce ();
965
964
966
- PrintTagsAroundAddr (
967
- untagged_addr + offset, [&](uptr addr) { return GetTagCopy (addr); },
968
- [&](uptr addr) { return GetShortTagCopy (addr); });
965
+ PrintTags (untagged_addr + offset);
969
966
970
967
if (registers_frame)
971
968
ReportRegisters (registers_frame, pc);
0 commit comments