forked from OSchip/llvm-project
[libFuzzer] add 'weak' back to __sanitizer_malloc_hook and __sanitizer_free_hook
llvm-svn: 272116
This commit is contained in:
parent
250024f905
commit
53b7b3ca5f
|
@ -464,10 +464,12 @@ static thread_local MallocFreeTracer AllocTracer;
|
||||||
// thread local storage is initialised leading to
|
// thread local storage is initialised leading to
|
||||||
// crashes when accessing ``AllocTracer``.
|
// crashes when accessing ``AllocTracer``.
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
__attribute__((weak))
|
||||||
void __sanitizer_malloc_hook(void *ptr, size_t size) {
|
void __sanitizer_malloc_hook(void *ptr, size_t size) {
|
||||||
if (!LIBFUZZER_APPLE)
|
if (!LIBFUZZER_APPLE)
|
||||||
AllocTracer.Mallocs++;
|
AllocTracer.Mallocs++;
|
||||||
}
|
}
|
||||||
|
__attribute__((weak))
|
||||||
void __sanitizer_free_hook(void *ptr) {
|
void __sanitizer_free_hook(void *ptr) {
|
||||||
if (!LIBFUZZER_APPLE)
|
if (!LIBFUZZER_APPLE)
|
||||||
AllocTracer.Frees++;
|
AllocTracer.Frees++;
|
||||||
|
|
Loading…
Reference in New Issue