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:    e113b6784aa92c74ec3f4d821ccc6492d4b1a52d
Author:    Dmitry Stogov <[email protected]>         Mon, 6 Mar 2017 17:09:05 +0300
Parents:   c6982995504b6e21e8a5ade29cfb16a55196dc43
Branches:  master

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

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.