Skip to content

Commit 9e1f056

Browse files
committed
More poisoning
1 parent 2e2efc3 commit 9e1f056

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Zend/zend_alloc.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1767,10 +1767,12 @@ static zend_always_inline void *zend_mm_realloc_heap(zend_mm_heap *heap, void *p
17671767
ZEND_ASAN_UNPOISON_MEMORY_REGION(ptr, copy_size);
17681768
memcpy(ret, ptr, copy_size);
17691769
zend_mm_free_small(heap, ptr, old_bin_num);
1770+
printf("Reallocated (2, 1) %zu bytes from %p to %p\n", size, ptr, ret);
17701771
} else {
17711772
/* reallocation in-place */
1772-
ZEND_ASAN_UNPOISON_MEMORY_REGION(ret, size);
17731773
ret = ptr;
1774+
ZEND_ASAN_UNPOISON_MEMORY_REGION(ret, size);
1775+
printf("Reallocated (2, 2) %zu bytes from %p to %p\n", size, ptr, ret);
17741776
}
17751777
} else if (size <= ZEND_MM_MAX_SMALL_SIZE) {
17761778
/* small extension */
@@ -1789,6 +1791,7 @@ static zend_always_inline void *zend_mm_realloc_heap(zend_mm_heap *heap, void *p
17891791
heap->peak = MAX(orig_peak, heap->size);
17901792
} while (0);
17911793
#endif
1794+
printf("Reallocated (2, 3) %zu bytes from %p to %p\n", size, ptr, ret);
17921795
} else {
17931796
/* slow reallocation */
17941797
break;
@@ -1803,7 +1806,6 @@ static zend_always_inline void *zend_mm_realloc_heap(zend_mm_heap *heap, void *p
18031806
dbg->orig_lineno = __zend_orig_lineno;
18041807
#endif
18051808
ZEND_ASAN_POISON_CHUNK_HEADER_NOT_HEAP(chunk, heap);
1806-
printf("Reallocated (2) %zu bytes from %p to %p\n", size, ptr, ret);
18071809
return ret;
18081810
} while (0);
18091811

0 commit comments

Comments
 (0)