Skip to content

Commit 9e97d64

Browse files
committed
[sanitizers][Darwin][NFC] Insert missing void* casts for printf %p (llvm#161282)
Add some missing void* casts where we were passing an int for %p on some platforms. rdar://161174839 (cherry picked from commit 5960f5c)
1 parent 25b64d1 commit 9e97d64

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
@@ -1141,8 +1141,8 @@ static void PrintVmmap() {
11411141
lastsz += vmsize;
11421142
} else {
11431143
if (lastsz)
1144-
Printf("|| `[%p, %p]` || size=0x%016" PRIx64 " ||\n", last,
1145-
last + lastsz, lastsz);
1144+
Printf("|| `[%p, %p]` || size=0x%016" PRIx64 " ||\n", (void*)last,
1145+
(void*)(last + lastsz), lastsz);
11461146

11471147
last = address;
11481148
lastsz = vmsize;
@@ -1152,8 +1152,8 @@ static void PrintVmmap() {
11521152
// We've reached the end of the memory map. Print the last remaining
11531153
// region, if there is one.
11541154
if (lastsz)
1155-
Printf("|| `[%p, %p]` || size=0x%016" PRIx64 " ||\n", last,
1156-
last + lastsz, lastsz);
1155+
Printf("|| `[%p, %p]` || size=0x%016" PRIx64 " ||\n", (void*)last,
1156+
(void*)(last + lastsz), lastsz);
11571157

11581158
break;
11591159
}
@@ -1164,7 +1164,7 @@ static void ReportShadowAllocFail(uptr shadow_size_bytes, uptr alignment) {
11641164
Report(
11651165
"FATAL: Failed to allocate shadow memory. Tried to allocate %p bytes "
11661166
"(alignment=%p).\n",
1167-
shadow_size_bytes, alignment);
1167+
(void*)shadow_size_bytes, (void*)alignment);
11681168
PrintVmmap();
11691169
}
11701170

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)