diff options
Diffstat (limited to 'base/process_util_mac.mm')
-rw-r--r-- | base/process_util_mac.mm | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/base/process_util_mac.mm b/base/process_util_mac.mm index 373d4cf..cf1e7a8 100644 --- a/base/process_util_mac.mm +++ b/base/process_util_mac.mm @@ -635,16 +635,18 @@ void EnableTerminationOnHeapCorruption() { // by AddressSanitizer. return; #endif + + // Only override once, otherwise CrMallocErrorBreak() will recurse + // to itself. + if (g_original_malloc_error_break) + return; + malloc_error_break_t malloc_error_break = LookUpMallocErrorBreak(); if (!malloc_error_break) { DLOG(WARNING) << "Could not find malloc_error_break"; return; } - // Warm this up so that it doesn't require allocation when - // |CrMallocErrorBreak()| calls it. - ignore_result(g_unchecked_malloc.Get().Get()); - mach_error_t err = mach_override_ptr( (void*)malloc_error_break, (void*)&CrMallocErrorBreak, |