Reduce memory needed by ASAN morgue

This commit is contained in:
Justine Tunney 2021-08-19 09:24:26 -07:00
parent d5a37de435
commit ed485391da
5 changed files with 34 additions and 10 deletions

View file

@ -594,7 +594,10 @@ static void __asan_deallocate(char *p, long kind) {
WRITE64BE(p + c - 8, kind);
__asan_poison((uintptr_t)p, c - 8, kind);
if (weaken(dlfree)) {
weaken(dlfree)(__asan_morgue_add(p));
if (c <= FRAMESIZE) {
p = __asan_morgue_add(p);
}
weaken(dlfree)(p);
}
} else {
__asan_report_heap_fault(p, n);