Skip to content

Commit 085d0c8

Browse files
committed
Fixup
1 parent 2178807 commit 085d0c8

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

Zend/zend_alloc.c

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1528,9 +1528,21 @@ static zend_always_inline zend_mm_free_slot *zend_mm_get_next_free_slot(zend_mm_
15281528

15291529
#else /* ZEND_MM_HEAP_PROTECTION */
15301530
# define zend_mm_set_next_free_slot(heap, bin_num, slot, next) do { \
1531-
(slot)->next_free_slot = (next); \
1531+
ZEND_MM_UNPOISON(slot, sizeof(zend_mm_free_slot*)); \
1532+
(slot)->next_free_slot = (next); \
1533+
ZEND_MM_POISON(slot, sizeof(zend_mm_free_slot*)); \
15321534
} while (0)
1533-
# define zend_mm_get_next_free_slot(heap, bin_num, slot) (slot)->next_free_slot
1535+
1536+
static zend_always_inline zend_mm_free_slot *zend_mm_get_next_free_slot(zend_mm_heap *heap, uint32_t bin_num, zend_mm_free_slot* slot)
1537+
{
1538+
ZEND_MM_UNPOISON(slot, sizeof(zend_mm_free_slot*));
1539+
1540+
zend_mm_free_slot *next = slot->next_free_slot;
1541+
1542+
ZEND_MM_POISON(slot, sizeof(zend_mm_free_slot*));
1543+
1544+
return (zend_mm_free_slot*)next;
1545+
}
15341546
#endif /* ZEND_MM_HEAP_PROTECTION */
15351547

15361548
static zend_never_inline void *zend_mm_alloc_small_slow(zend_mm_heap *heap, uint32_t bin_num ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)

0 commit comments

Comments
 (0)