logo       

cvs: ZendEngine2(PHP_5_1) / zend_execute.c /tests bug34137.phpt php-src N: msg#00004

Subject: cvs: ZendEngine2(PHP_5_1) / zend_execute.c /tests bug34137.phpt php-src NEWS
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




<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
science.linguis...    culture.sf.lite...    video.mplayer.c...    yellowdog.gener...    ietf.rfc822/199...    emacs.help/2002...    redhat.release....    kernel.speakup/...    java.openejb.de...    debian.devel.gt...    xfree86.newbie/...    bug-tracking.ma...    pam/2003-05/msg...    games.devel.ope...    user-groups.lin...    music.pancham/2...    network.mq.deve...    web.html.genera...    arklinux.bugs/2...    linux.ecasound/...    qnx.openqnx.dev...    org.user-groups...    file-systems.sf...    trustix.contrib...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe