diff --git a/compiler-rt/lib/asan/asan_malloc_linux.cpp b/compiler-rt/lib/asan/asan_malloc_linux.cpp --- a/compiler-rt/lib/asan/asan_malloc_linux.cpp +++ b/compiler-rt/lib/asan/asan_malloc_linux.cpp @@ -115,7 +115,11 @@ } #endif // SANITIZER_INTERCEPT_ALIGNED_ALLOC +#if !SANITIZER_FREEBSD INTERCEPTOR(uptr, malloc_usable_size, void *ptr) { +#else +INTERCEPTOR(uptr, malloc_usable_size, const void *ptr) { +#endif GET_CURRENT_PC_BP_SP; (void)sp; return asan_malloc_usable_size(ptr, pc, bp); diff --git a/compiler-rt/lib/msan/msan_interceptors.cpp b/compiler-rt/lib/msan/msan_interceptors.cpp --- a/compiler-rt/lib/msan/msan_interceptors.cpp +++ b/compiler-rt/lib/msan/msan_interceptors.cpp @@ -232,7 +232,11 @@ #endif #if !SANITIZER_NETBSD +#if !SANITIZER_FREEBSD INTERCEPTOR(uptr, malloc_usable_size, void *ptr) { +#else +INTERCEPTOR(uptr, malloc_usable_size, const void *ptr) { +#endif return __sanitizer_get_allocated_size(ptr); } #define MSAN_MAYBE_INTERCEPT_MALLOC_USABLE_SIZE \