From: Nikita Popov Date: Thu, 22 Aug 2013 08:56:50 +0000 (+0200) Subject: Fix bug #46311: Pointer aliasing issue results in miscompile on gcc4.4 X-Git-Tag: php-5.5.4RC1~24 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=fc16b923135bf1670f6791d3998aeb19edde1ca5;p=php Fix bug #46311: Pointer aliasing issue results in miscompile on gcc4.4 The code violated the strict aliasing restriction, because it dereferenced the same pointer as zval** once and as void** afterwards. Now both occurances dereference void** and cast to zval* in the former case. --- diff --git a/NEWS b/NEWS index 75a0b3c6b9..6d62951e75 100644 --- a/NEWS +++ b/NEWS @@ -7,6 +7,8 @@ PHP NEWS --enable-dtrace). (Chris Jones, Kris Van Hees) . Fixed bug #65225 (PHP_BINARY incorrectly set). (Patrick Allaert) . Fixed bug #62692 (PHP fails to build with DTrace). (Chris Jones, Kris Van Hees) + . Fixed bug #46311 (Pointer aliasing issue results in miscompile on gcc4.4). + (Nikita Popov) - cURL: . Fixed bug #65458 (curl memory leak). (Adam) diff --git a/Zend/zend_execute.h b/Zend/zend_execute.h index a17f10b312..35c5bcaef1 100644 --- a/Zend/zend_execute.h +++ b/Zend/zend_execute.h @@ -293,7 +293,7 @@ static zend_always_inline void zend_vm_stack_clear_multiple(int nested TSRMLS_DC void **end = p - (int)(zend_uintptr_t)*p; while (p != end) { - zval *q = *(zval **)(--p); + zval *q = *(--p); *p = NULL; i_zval_ptr_dtor(q ZEND_FILE_LINE_CC); }