@@ -306,8 +306,9 @@ static void PrintStackAllocations(const StackAllocationsRingBuffer *sa,
306
306
" %p is located %zd bytes %s a %zd-byte local variable %s "
307
307
" [%p,%p) "
308
308
" in %s %s\n " ,
309
- untagged_addr, offset, whence, local.size , local.name , best_beg,
310
- best_beg + local.size , local.function_name , location.data ());
309
+ (void *)untagged_addr, offset, whence, local.size , local.name ,
310
+ (void *)best_beg, (void *)(best_beg + local.size ),
311
+ local.function_name , location.data ());
311
312
location.clear ();
312
313
Printf (" %s\n " , d.Default ());
313
314
}
@@ -738,8 +739,8 @@ void BaseReport::PrintHeapOrGlobalCandidate() const {
738
739
Printf (" %s" , d.Location ());
739
740
Printf (" %p is located %zd bytes %s a %zd-byte region [%p,%p)\n " ,
740
741
untagged_addr, offset, whence,
741
- candidate.heap .end - candidate.heap .begin , candidate. heap . begin ,
742
- candidate.heap .end );
742
+ candidate.heap .end - candidate.heap .begin ,
743
+ ( void *)candidate. heap . begin , ( void *) candidate.heap .end );
743
744
Printf (" %s" , d.Allocation ());
744
745
Printf (" allocated by thread T%u here:\n " , candidate.heap .thread_id );
745
746
Printf (" %s" , d.Default ());
@@ -762,26 +763,26 @@ void BaseReport::PrintHeapOrGlobalCandidate() const {
762
763
Printf (
763
764
" %p is located %zd bytes %s a %zd-byte global variable "
764
765
" %s [%p,%p) in %s\n " ,
765
- untagged_addr,
766
+ ( void *) untagged_addr,
766
767
candidate.after ? untagged_addr - (info.start + info.size )
767
768
: info.start - untagged_addr,
768
769
candidate.after ? " after" : " before" , info.size , info.name ,
769
- info.start , info.start + info.size , module_name);
770
+ ( void *) info.start , ( void *)( info.start + info.size ) , module_name);
770
771
} else {
771
772
uptr size = GetGlobalSizeFromDescriptor (candidate.untagged_addr );
772
773
if (size == 0 )
773
774
// We couldn't find the size of the global from the descriptors.
774
775
Printf (
775
776
" %p is located %s a global variable in "
776
777
" \n #0 0x%x (%s+0x%x)\n " ,
777
- untagged_addr, candidate.after ? " after" : " before" ,
778
- candidate.untagged_addr , module_name, module_address);
778
+ ( void *) untagged_addr, candidate.after ? " after" : " before" ,
779
+ ( void *) candidate.untagged_addr , module_name, ( u32 ) module_address);
779
780
else
780
781
Printf (
781
782
" %p is located %s a %zd-byte global variable in "
782
783
" \n #0 0x%x (%s+0x%x)\n " ,
783
- untagged_addr, candidate.after ? " after" : " before" , size,
784
- candidate.untagged_addr , module_name, module_address);
784
+ ( void *) untagged_addr, candidate.after ? " after" : " before" , size,
785
+ ( void *) candidate.untagged_addr , module_name, ( u32 ) module_address);
785
786
}
786
787
Printf (" %s" , d.Default ());
787
788
}
@@ -792,8 +793,8 @@ void BaseReport::PrintAddressDescription() const {
792
793
int num_descriptions_printed = 0 ;
793
794
794
795
if (MemIsShadow (untagged_addr)) {
795
- Printf (" %s%p is HWAsan shadow memory.\n %s" , d.Location (), untagged_addr,
796
- d.Default ());
796
+ Printf (" %s%p is HWAsan shadow memory.\n %s" , d.Location (),
797
+ ( void *)untagged_addr, d.Default ());
797
798
return ;
798
799
}
799
800
@@ -802,7 +803,7 @@ void BaseReport::PrintAddressDescription() const {
802
803
Printf (
803
804
" %s[%p,%p) is a %s %s heap chunk; "
804
805
" size: %zd offset: %zd\n %s" ,
805
- d.Location (), heap.begin , heap.begin + heap.size ,
806
+ d.Location (), ( void *) heap.begin , ( void *)( heap.begin + heap.size ) ,
806
807
heap.from_small_heap ? " small" : " large" ,
807
808
heap.is_allocated ? " allocated" : " unallocated" , heap.size ,
808
809
untagged_addr - heap.begin , d.Default ());
@@ -821,8 +822,8 @@ void BaseReport::PrintAddressDescription() const {
821
822
Printf (" %s" , d.Error ());
822
823
Printf (" \n Cause: stack tag-mismatch\n " );
823
824
Printf (" %s" , d.Location ());
824
- Printf (" Address %p is located in stack of thread T%zd\n " , untagged_addr,
825
- sa.thread_id ());
825
+ Printf (" Address %p is located in stack of thread T%zd\n " ,
826
+ ( void *)untagged_addr, (ssize) sa.thread_id ());
826
827
Printf (" %s" , d.Default ());
827
828
announce_by_id (sa.thread_id ());
828
829
PrintStackAllocations (sa.get (), ptr_tag, untagged_addr);
@@ -842,9 +843,9 @@ void BaseReport::PrintAddressDescription() const {
842
843
Printf (" \n Cause: use-after-free\n " );
843
844
Printf (" %s" , d.Location ());
844
845
Printf (" %p is located %zd bytes inside a %zd-byte region [%p,%p)\n " ,
845
- untagged_addr, untagged_addr - UntagAddr (har.tagged_addr ),
846
- har.requested_size , UntagAddr (har.tagged_addr ),
847
- UntagAddr (har.tagged_addr ) + har.requested_size );
846
+ ( void *) untagged_addr, untagged_addr - UntagAddr (har.tagged_addr ),
847
+ (ssize) har.requested_size , UntagAddr (har.tagged_addr ),
848
+ ( void *)( UntagAddr (har.tagged_addr ) + har.requested_size ) );
848
849
Printf (" %s" , d.Allocation ());
849
850
Printf (" freed by thread T%u here:\n " , ha.free_thread_id );
850
851
Printf (" %s" , d.Default ());
@@ -858,7 +859,7 @@ void BaseReport::PrintAddressDescription() const {
858
859
// Print a developer note: the index of this heap object
859
860
// in the thread's deallocation ring buffer.
860
861
Printf (" hwasan_dev_note_heap_rb_distance: %zd %zd\n " , ha.ring_index + 1 ,
861
- flags ()->heap_history_size );
862
+ (ssize) flags ()->heap_history_size );
862
863
Printf (" hwasan_dev_note_num_matching_addrs: %zd\n " , ha.num_matching_addrs );
863
864
Printf (" hwasan_dev_note_num_matching_addrs_4b: %zd\n " ,
864
865
ha.num_matching_addrs_4b );
@@ -915,10 +916,11 @@ InvalidFreeReport::~InvalidFreeReport() {
915
916
const Thread *thread = GetCurrentThread ();
916
917
if (thread) {
917
918
Report (" ERROR: %s: %s on address %p at pc %p on thread T%zd\n " ,
918
- SanitizerToolName, bug_type, untagged_addr, pc, thread->unique_id ());
919
+ SanitizerToolName, bug_type, (void *)untagged_addr, (void *)pc,
920
+ (ssize)thread->unique_id ());
919
921
} else {
920
922
Report (" ERROR: %s: %s on address %p at pc %p on unknown thread\n " ,
921
- SanitizerToolName, bug_type, untagged_addr, pc);
923
+ SanitizerToolName, bug_type, ( void *) untagged_addr, ( void *) pc);
922
924
}
923
925
Printf (" %s" , d.Access ());
924
926
if (shadow.addr ) {
@@ -967,7 +969,8 @@ TailOverwrittenReport::~TailOverwrittenReport() {
967
969
Printf (" %s" , d.Error ());
968
970
const char *bug_type = " allocation-tail-overwritten" ;
969
971
Report (" ERROR: %s: %s; heap object [%p,%p) of size %zd\n " , SanitizerToolName,
970
- bug_type, untagged_addr, untagged_addr + orig_size, orig_size);
972
+ bug_type, (void *)untagged_addr, (void *)(untagged_addr + orig_size),
973
+ orig_size);
971
974
Printf (" \n %s" , d.Default ());
972
975
Printf (
973
976
" Stack of invalid access unknown. Issue detected at deallocation "
@@ -1037,7 +1040,7 @@ TagMismatchReport::~TagMismatchReport() {
1037
1040
uptr pc = GetTopPc (stack);
1038
1041
Printf (" %s" , d.Error ());
1039
1042
Report (" ERROR: %s: %s on address %p at pc %p\n " , SanitizerToolName, bug_type,
1040
- untagged_addr, pc);
1043
+ ( void *) untagged_addr, ( void *) pc);
1041
1044
1042
1045
Thread *t = GetCurrentThread ();
1043
1046
@@ -1049,12 +1052,12 @@ TagMismatchReport::~TagMismatchReport() {
1049
1052
GetShortTagCopy (MemToShadow (untagged_addr + mismatch_offset));
1050
1053
Printf (
1051
1054
" %s of size %zu at %p tags: %02x/%02x(%02x) (ptr/mem) in thread T%zd\n " ,
1052
- is_store ? " WRITE" : " READ" , access_size, untagged_addr, ptr_tag ,
1053
- mem_tag, short_tag, t->unique_id ());
1055
+ is_store ? " WRITE" : " READ" , access_size, ( void *)untagged_addr ,
1056
+ ptr_tag, mem_tag, short_tag, (ssize) t->unique_id ());
1054
1057
} else {
1055
1058
Printf (" %s of size %zu at %p tags: %02x/%02x (ptr/mem) in thread T%zd\n " ,
1056
- is_store ? " WRITE" : " READ" , access_size, untagged_addr, ptr_tag ,
1057
- mem_tag, t->unique_id ());
1059
+ is_store ? " WRITE" : " READ" , access_size, ( void *)untagged_addr ,
1060
+ ptr_tag, mem_tag, (ssize) t->unique_id ());
1058
1061
}
1059
1062
if (mismatch_offset)
1060
1063
Printf (" Invalid access starting at offset %zu\n " , mismatch_offset);
@@ -1093,7 +1096,7 @@ void ReportTagMismatch(StackTrace *stack, uptr tagged_addr, uptr access_size,
1093
1096
// See the frame breakdown defined in __hwasan_tag_mismatch (from
1094
1097
// hwasan_tag_mismatch_{aarch64,riscv64}.S).
1095
1098
void ReportRegisters (const uptr *frame, uptr pc) {
1096
- Printf (" \n Registers where the failure occurred (pc %p):\n " , pc);
1099
+ Printf (" \n Registers where the failure occurred (pc %p):\n " , ( void *) pc);
1097
1100
1098
1101
// We explicitly print a single line (4 registers/line) each iteration to
1099
1102
// reduce the amount of logcat error messages printed. Each Printf() will
0 commit comments