com php-src: Ensure pointer alignment.: ext/opcache/Optimizer/z end_worklist.h

[email protected] (Dmitry Stogov)
Newsgroups php.cvs
Message-ID <[email protected]>
Commit:    b273a8cbe44cf9ec13c6201c53eb52b9a66cc93b
Author:    Dmitry Stogov <[email protected]>         Mon, 6 Mar 2017 17:09:05 +0300
Parents:   6158b517c437e2b49f50a6807267c200492e6b74
Branches:  PHP-7.1 master

Link:       http://git.php.net/?p=php-src.git;a=commitdiff;h=b273a8cbe44cf9ec13c6201c53eb52b9a66cc93b

Log:
Ensure pointer alignment.

Changed paths:
  M  ext/opcache/Optimizer/zend_worklist.h


Diff:
diff --git a/ext/opcache/Optimizer/zend_worklist.h b/ext/opcache/Optimizer/zend_worklist.h
index 332dbde..73c0bca 100644
--- a/ext/opcache/Optimizer/zend_worklist.h
+++ b/ext/opcache/Optimizer/zend_worklist.h
@@ -77,10 +77,10 @@ typedef struct _zend_worklist {
 } zend_worklist;
 
 #define ZEND_WORKLIST_ALLOCA(w, _len, use_heap) do { \
-		(w)->stack.buf = (int*)do_alloca(sizeof(int) * _len + sizeof(zend_ulong) * zend_bitset_len(_len), use_heap); \
+		(w)->stack.buf = (int*)do_alloca(ZEND_MM_ALIGNED_SIZE(sizeof(int) * _len) + sizeof(zend_ulong) * zend_bitset_len(_len), use_heap); \
 		(w)->stack.len = 0; \
 		(w)->stack.capacity = _len; \
-		(w)->visited = (zend_bitset)((w)->stack.buf + _len); \
+		(w)->visited = (zend_bitset)((char*)(w)->stack.buf + ZEND_MM_ALIGNED_SIZE(sizeof(int) * _len)); \
 		memset((w)->visited, 0, sizeof(zend_ulong) * zend_bitset_len(_len)); \
 	} while (0)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.