Skip to content

Commit f391cd7

Browse files
committed
Ensure consistent type for ZEND_MM_ALIGNED_BASE
Now it always produces a void* value across the builtin and bitwise operator implementations.
1 parent 526ee4f commit f391cd7

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Zend/zend_alloc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,12 +177,12 @@ typedef zend_ulong zend_mm_bitset; /* 4-byte or 8-byte integer */
177177

178178
#ifdef PHP_HAVE_BUILTIN_ALIGN_DOWN
179179
# define ZEND_MM_ALIGNED_BASE(ptr, alignment) \
180-
__builtin_align_down((ptr), (alignment))
180+
__builtin_align_down((void*)(ptr), (alignment))
181181
# define ZEND_MM_ALIGNED_OFFSET(ptr, alignment) \
182182
(((size_t)(ptr)) - (size_t)ZEND_MM_ALIGNED_BASE(ptr, alignment))
183183
#else
184184
# define ZEND_MM_ALIGNED_BASE(ptr, alignment) \
185-
(((uintptr_t)(ptr)) & ~((alignment) - 1))
185+
((void*)(((uintptr_t)(ptr)) & ~((alignment) - 1)))
186186
# define ZEND_MM_ALIGNED_OFFSET(ptr, alignment) \
187187
(((size_t)(ptr)) & ((alignment) - 1))
188188
#endif

0 commit comments

Comments
 (0)