From 199eb2b110aa57c423bada077f6c9e71c5d17daf Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Mon, 10 Jun 2019 12:51:59 +0300 Subject: [PATCH] Fixed possible misalignment in 32-bit build. --- ext/opcache/ZendAccelerator.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ext/opcache/ZendAccelerator.c b/ext/opcache/ZendAccelerator.c index 257f9b43f43..b57d446df54 100644 --- a/ext/opcache/ZendAccelerator.c +++ b/ext/opcache/ZendAccelerator.c @@ -1289,6 +1289,10 @@ static zend_persistent_script *store_script_in_file_cache(zend_persistent_script /* Align to 64-byte boundary */ ZCG(mem) = zend_arena_alloc(&CG(arena), memory_used + 64); ZCG(mem) = (void*)(((zend_uintptr_t)ZCG(mem) + 63L) & ~63L); +#elif ZEND_MM_ALIGNMENT < 8 + /* Align to 8-byte boundary */ + ZCG(mem) = zend_arena_alloc(&CG(arena), memory_used + 8); + ZCG(mem) = (void*)(((zend_uintptr_t)ZCG(mem) + 7L) & ~7L); #else ZCG(mem) = zend_arena_alloc(&CG(arena), memory_used); #endif