dmitry Thu Sep 1 09:21:37 2005 EDT
Added files: (Branch: PHP_5_1)
/ZendEngine2/tests bug34137.phpt
Modified files:
/php-src NEWS
/ZendEngine2 zend_execute.c
Log:
Fixed bug #34137 (assigning array element by reference causes binary mess)
http://cvs.php.net/diff.php/php-src/NEWS?r1=1.2027.2.42&r2=1.2027.2.43&ty=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.42 php-src/NEWS:1.2027.2.43
--- php-src/NEWS:1.2027.2.42 Thu Sep 1 08:42:33 2005
+++ php-src/NEWS Thu Sep 1 09:21:36 2005
@@ -34,6 +34,8 @@
- Fixed bug #34156 (memory usage remains elevated after memory limit is
reached). (Ilia)
- Fixed bug #34148 (+,- and . not supported as parts of scheme). (Ilia)
+- Fixed bug #34137 (assigning array element by reference causes binary mess).
+ (Dmitry)
- Fixed bug #34103 (line numbering not maintained in dom document). (Rob)
- Fixed bug #34078 (Reflection API problems in methods with boolean or
null default values). (Tony)
http://cvs.php.net/diff.php/ZendEngine2/zend_execute.c?r1=1.716&r2=1.716.2.1&ty=u
Index: ZendEngine2/zend_execute.c
diff -u ZendEngine2/zend_execute.c:1.716 ZendEngine2/zend_execute.c:1.716.2.1
--- ZendEngine2/zend_execute.c:1.716 Fri Aug 5 05:34:27 2005
+++ ZendEngine2/zend_execute.c Thu Sep 1 09:21:36 2005
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_execute.c,v 1.716 2005/08/05 09:34:27 dmitry Exp $ */
+/* $Id: zend_execute.c,v 1.716.2.1 2005/09/01 13:21:36 dmitry Exp $ */
#define ZEND_INTENSIVE_DEBUGGING 0
@@ -392,12 +392,6 @@
if (variable_ptr == EG(error_zval_ptr) ||
value_ptr==EG(error_zval_ptr)) {
variable_ptr_ptr = &EG(uninitialized_zval_ptr);
} else if (variable_ptr != value_ptr) {
- variable_ptr->refcount--;
- if (variable_ptr->refcount==0) {
- zendi_zval_dtor(*variable_ptr);
- FREE_ZVAL(variable_ptr);
- }
-
if (!PZVAL_IS_REF(value_ptr)) {
/* break it away */
value_ptr->refcount--;
@@ -413,6 +407,12 @@
*variable_ptr_ptr = value_ptr;
value_ptr->refcount++;
+
+ variable_ptr->refcount--;
+ if (variable_ptr->refcount==0) {
+ zendi_zval_dtor(*variable_ptr);
+ FREE_ZVAL(variable_ptr);
+ }
} else if (!variable_ptr->is_ref) {
if (variable_ptr_ptr == value_ptr_ptr) {
SEPARATE_ZVAL(variable_ptr_ptr);
http://cvs.php.net/co.php/ZendEngine2/tests/bug34137.phpt?r=1.1&p=1
Index: ZendEngine2/tests/bug34137.phpt
+++ ZendEngine2/tests/bug34137.phpt
--TEST--
Bug #34137 (assigning array element by reference causes binary mess)
--FILE--
<?php
$arr1 = array('a1' => array('alfa' => 'ok'));
$arr1 =& $arr1['a1'];
echo '-'.$arr1['alfa']."-\n";
?>
--EXPECT--
-ok-
--
Zend Engine CVS Mailing List (http://cvs.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
|