com php-src: Fixed possible misalignment in 32-bit build.: ext/opcache/ZendAccelerator.c
| From: | Dmitry Stogov | Date: | Mon, 10 Jun 2019 09:51:59 +0000 |
| Subject: | com php-src: Fixed possible misalignment in 32-bit build.: ext/opcache/ZendAccelerator.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-106626@lists.php.net to get a copy of this message | ||
Commit: 199eb2b110aa57c423bada077f6c9e71c5d17daf
Author: Dmitry Stogov <dmitry@zend.com> Mon, 10 Jun 2019 12:51:59 +0300
Parents: 65ada393602ad6125928c33a5c18dd05c84c29fa
Branches: PHP-7.2 PHP-7.3 PHP-7..4 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=199eb2b110aa57c423bada077f6c9e71c5d17daf
Log:
Fixed possible misalignment in 32-bit build.
Changed paths:
M ext/opcache/ZendAccelerator.c
Diff:
diff --git a/ext/opcache/ZendAccelerator.c b/ext/opcache/ZendAccelerator.c
index 257f9b4..b57d446 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