cvs: ZendEngine2(PHP_5_0) / zend_execute.c /tests bug31828.phpt bug32080.phpt bug32852.phpt php-src NEWS

From: Date: Fri, 29 Apr 2005 07:03:36 +0000
Subject: cvs: ZendEngine2(PHP_5_0) / zend_execute.c /tests bug31828.phpt bug32080.phpt bug32852.phpt php-src NEWS
Groups: php.zend-engine.cvs 
Request: Send a blank email to php-zend-engine-cvs+get-3613@lists.php.net to get a copy of this message
dmitry Fri Apr 29 03:03:36 2005 EDT Added files: (Branch: PHP_5_0) /ZendEngine2/tests bug31828.phpt bug32080.phpt bug32852.phpt Modified files: /php-src NEWS /ZendEngine2 zend_execute.c Log: Fixed bug #32852 (Crash with singleton and __destruct when zend.ze1_compatibility_mode = On) Fixed bug #31828 (Crash with zend.ze1_compatibility_mode=On) Fixed bug #32080 (segfault when assigning object to itself with zend.ze1_compatibility_mode=On) http://cvs.php.net/diff.php/php-src/NEWS?r1=1.1760.2.359&r2=1.1760.2.360&ty=u Index: php-src/NEWS diff -u php-src/NEWS:1.1760.2.359 php-src/NEWS:1.1760.2.360 --- php-src/NEWS:1.1760.2.359 Thu Apr 28 13:39:51 2005 +++ php-src/NEWS Fri Apr 29 03:03:33 2005 @@ -9,6 +9,8 @@ - Fixed ext/mysqli to allocate less memory when fetching bound params of type (MEDIUM|LONG)BLOB/(MEDIUM|LONG)TEXT. (Andrey) - Fixed memory corruption in ImageTTFText() with 64bit systems. (Andrey) +- Fixed bug #32852 (Crash with singleton and __destruct when + zend.ze1_compatibility_mode = On). (Dmitry) - Fixed bug #32813 (parse_url() does not handle scheme-only urls properly). (Ilia) - Fixed bug #32809 (Missing T1LIB support on Windows). (Edin) - Fixed bug #32802 (General cookie overrides more specific cookie). (Ilia) @@ -46,10 +48,13 @@ - Fixed bug #32282 (Segfault in mysqli_fetch_array on 64-bit). (Georg) - Fixed bug #32245 (xml_parser_free() in a function assigned to the xml parser gives a segfault). (Rob) +- Fixed bug #32080 (segfault when assigning object to itself with + zend.ze1_compatibility_mode=On). (Dmitry) - Fixed bug #32013 (ext/mysqli bind_result causes fatal error: memory limit). (Andrey) - Fixed bug #31887 (ISAPI: Custom 5xx error does not return correct HTTP response message). (Jani) +- Fixed bug #31828 (Crash with zend.ze1_compatibility_mode=On). (Dmitry) - Fixed bug #31668 (multi_query works exactly every other time - multi query d/e flag global and not per connection). (Andrey) - Fixed bug #31636 (another crash when echoing a COM object). (Wez) http://cvs.php.net/diff.php/ZendEngine2/zend_execute.c?r1=1.652.2.25&r2=1.652.2.26&ty=u Index: ZendEngine2/zend_execute.c diff -u ZendEngine2/zend_execute.c:1.652.2.25 ZendEngine2/zend_execute.c:1.652.2.26 --- ZendEngine2/zend_execute.c:1.652.2.25 Wed Apr 27 02:46:43 2005 +++ ZendEngine2/zend_execute.c Fri Apr 29 03:03:34 2005 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_execute.c,v 1.652.2.25 2005/04/27 06:46:43 dmitry Exp $ */ +/* $Id: zend_execute.c,v 1.652.2.26 2005/04/29 07:03:34 dmitry Exp $ */ #define ZEND_INTENSIVE_DEBUGGING 0 @@ -568,7 +568,7 @@ if (Z_OBJ_HANDLER_P(value, clone_obj) == NULL) { zend_error(E_ERROR, "Trying to clone an uncloneable object of class %s", Z_OBJCE_P(value)->name); } else if (PZVAL_IS_REF(variable_ptr)) { - if (variable_ptr != value) { + if (variable_ptr != value) { zend_uint refcount = variable_ptr->refcount; zval garbage; @@ -587,17 +587,21 @@ zendi_zval_dtor(garbage); } } else { - variable_ptr->refcount--; - if (variable_ptr->refcount == 0) { - zendi_zval_dtor(*variable_ptr); - } else { - ALLOC_ZVAL(variable_ptr); - *variable_ptr_ptr = variable_ptr; + if (variable_ptr != value) { + value->refcount++; + variable_ptr->refcount--; + if (variable_ptr->refcount == 0) { + zendi_zval_dtor(*variable_ptr); + } else { + ALLOC_ZVAL(variable_ptr); + *variable_ptr_ptr = variable_ptr; + } + *variable_ptr = *value; + INIT_PZVAL(variable_ptr); + zend_error(E_STRICT, "Implicit cloning object of class '%s' because of 'zend.ze1_compatibility_mode'", Z_OBJCE_P(value)->name); + variable_ptr->value.obj = Z_OBJ_HANDLER_P(value, clone_obj)(value TSRMLS_CC); + zval_ptr_dtor(&value); } - *variable_ptr = *value; - INIT_PZVAL(variable_ptr); - zend_error(E_STRICT, "Implicit cloning object of class '%s' because of 'zend.ze1_compatibility_mode'", Z_OBJCE_P(value)->name); - variable_ptr->value.obj = Z_OBJ_HANDLER_P(value, clone_obj)(value TSRMLS_CC); } } else if (PZVAL_IS_REF(variable_ptr)) { if (variable_ptr!=value) { http://cvs.php.net/co.php/ZendEngine2/tests/bug31828.phpt?r=1.1&p=1 Index: ZendEngine2/tests/bug31828.phpt +++ ZendEngine2/tests/bug31828.phpt http://cvs.php.net/co.php/ZendEngine2/tests/bug32080.phpt?r=1.1&p=1 Index: ZendEngine2/tests/bug32080.phpt +++ ZendEngine2/tests/bug32080.phpt http://cvs.php.net/co.php/ZendEngine2/tests/bug32852.phpt?r=1.1&p=1 Index: ZendEngine2/tests/bug32852.phpt +++ ZendEngine2/tests/bug32852.phpt

« previous php.zend-engine.cvs (#3613) next »