Skip to content

Commit 0742edb

Browse files
committed
Fixed bug #39702 (php crashes in the allocator on linux-m68k)
1 parent de9574e commit 0742edb

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

NEWS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ PHP NEWS
4444
php_filter.h).
4545
- Fixed wrong signature initialization in imagepng (Takeshi Abe)
4646
- Added optimization for imageline with horizontal and vertial lines (Pierre)
47+
- Fixed bug #39702 (php crashes in the allocator on linux-m68k). (Dmitry)
4748
- Fixed bug #39673 (file_get_contents causes bus error on certain offsets).
4849
(Tony)
4950
- Fixed bug #39663 (Memory leak in pg_get_notify() and a possible memory

Zend/zend_alloc.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,11 @@ struct _zend_mm_heap {
373373
#ifndef ZEND_MM_ALIGNMENT
374374
# define ZEND_MM_ALIGNMENT 8
375375
# define ZEND_MM_ALIGNMENT_LOG2 3
376+
#elif ZEND_MM_ALIGNMENT < 4
377+
# undef ZEND_MM_ALIGNMENT
378+
# undef ZEND_MM_ALIGNMENT
379+
# define ZEND_MM_ALIGNMENT 4
380+
# define ZEND_MM_ALIGNMENT_LOG2 2
376381
#endif
377382

378383
#define ZEND_MM_ALIGNMENT_MASK ~(ZEND_MM_ALIGNMENT-1)
@@ -587,6 +592,8 @@ ZEND_API zend_mm_heap *zend_mm_startup_ex(const zend_mm_mem_handlers *handlers,
587592
#if 0
588593
int i;
589594

595+
printf("ZEND_MM_ALIGNMENT=%d\n", ZEND_MM_ALIGNMENT);
596+
printf("ZEND_MM_ALIGNMENT_LOG2=%d\n", ZEND_MM_ALIGNMENT_LOG2);
590597
printf("ZEND_MM_MIN_SIZE=%d\n", ZEND_MM_MIN_SIZE);
591598
printf("ZEND_MM_MAX_SMALL_SIZE=%d\n", ZEND_MM_MAX_SMALL_SIZE);
592599
printf("ZEND_MM_ALIGNED_HEADER_SIZE=%d\n", ZEND_MM_ALIGNED_HEADER_SIZE);

0 commit comments

Comments
 (0)