Skip to content

Commit 5960f5c

Browse files
authored
[sanitizers][Darwin][NFC] Insert missing void* casts for printf %p (#161282)
Add some missing void* casts where we were passing an int for %p on some platforms. rdar://161174839
1 parent b98ac06 commit 5960f5c

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

compiler-rt/lib/sanitizer_common/sanitizer_mac.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1147,8 +1147,8 @@ static void PrintVmmap() {
11471147
lastsz += vmsize;
11481148
} else {
11491149
if (lastsz)
1150-
Printf("|| `[%p, %p]` || size=0x%016" PRIx64 " ||\n", last,
1151-
last + lastsz, lastsz);
1150+
Printf("|| `[%p, %p]` || size=0x%016" PRIx64 " ||\n", (void*)last,
1151+
(void*)(last + lastsz), lastsz);
11521152

11531153
last = address;
11541154
lastsz = vmsize;
@@ -1158,8 +1158,8 @@ static void PrintVmmap() {
11581158
// We've reached the end of the memory map. Print the last remaining
11591159
// region, if there is one.
11601160
if (lastsz)
1161-
Printf("|| `[%p, %p]` || size=0x%016" PRIx64 " ||\n", last,
1162-
last + lastsz, lastsz);
1161+
Printf("|| `[%p, %p]` || size=0x%016" PRIx64 " ||\n", (void*)last,
1162+
(void*)(last + lastsz), lastsz);
11631163

11641164
break;
11651165
}
@@ -1170,7 +1170,7 @@ static void ReportShadowAllocFail(uptr shadow_size_bytes, uptr alignment) {
11701170
Report(
11711171
"FATAL: Failed to allocate shadow memory. Tried to allocate %p bytes "
11721172
"(alignment=%p).\n",
1173-
shadow_size_bytes, alignment);
1173+
(void*)shadow_size_bytes, (void*)alignment);
11741174
PrintVmmap();
11751175
}
11761176

compiler-rt/lib/tsan/rtl/tsan_platform_mac.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ void InitializePlatformEarly() {
239239
Report(
240240
"ThreadSanitizer: Unsupported virtual memory layout: Address %p is "
241241
"already mapped.\n",
242-
HiAppMemEnd() - 1);
242+
(void*)(HiAppMemEnd() - 1));
243243
Die();
244244
}
245245
#endif

0 commit comments

Comments
 (0)