logo       
Google Custom Search
    AddThis Social Bookmark Button
-->

cvs: ZendEngine2(PHP_5_0) / zend_execute.c /tests bug22836.phpt php-src N: msg#00060

Subject: cvs: ZendEngine2(PHP_5_0) / zend_execute.c /tests bug22836.phpt php-src NEWS
dmitry          Fri May 27 12:05:52 2005 EDT

  Modified files:              (Branch: PHP_5_0)
    /php-src    NEWS 
    /ZendEngine2        zend_execute.c 
    /ZendEngine2/tests  bug22836.phpt 
  Log:
  Fixed bug #22836 (returning reference to uninitialized variable)
  
  
http://cvs.php.net/diff.php/php-src/NEWS?r1=1.1760.2.403&r2=1.1760.2.404&ty=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.1760.2.403 php-src/NEWS:1.1760.2.404
--- php-src/NEWS:1.1760.2.403   Fri May 27 03:21:11 2005
+++ php-src/NEWS        Fri May 27 12:05:47 2005
@@ -128,6 +128,7 @@
   mem vars und others). (Dmitry)
 - Fixed bug #28839 (SIGSEGV in interactive mode (php -a)).
   (kameshj at fastmail dot fm)
+- Fixed bug #22836 (returning reference to uninitialized variable). (Dmitry)
 
 31 Mar 2005, PHP 5.0.4
 - Added SNMPv2 support. (harrie)
http://cvs.php.net/diff.php/ZendEngine2/zend_execute.c?r1=1.652.2.31&r2=1.652.2.32&ty=u
Index: ZendEngine2/zend_execute.c
diff -u ZendEngine2/zend_execute.c:1.652.2.31 
ZendEngine2/zend_execute.c:1.652.2.32
--- ZendEngine2/zend_execute.c:1.652.2.31       Thu May  5 13:36:52 2005
+++ ZendEngine2/zend_execute.c  Fri May 27 12:05:51 2005
@@ -17,7 +17,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: zend_execute.c,v 1.652.2.31 2005/05/05 17:36:52 dmitry Exp $ */
+/* $Id: zend_execute.c,v 1.652.2.32 2005/05/27 16:05:51 dmitry Exp $ */
 
 #define ZEND_INTENSIVE_DEBUGGING 0
 
@@ -2927,7 +2927,8 @@
                        zend_error(E_STRICT, "Implicit cloning object of class 
'%s' because of 'zend.ze1_compatibility_mode'", Z_OBJCE_P(retval_ptr)->name);
                        (*EG(return_value_ptr_ptr))->value.obj = 
Z_OBJ_HT_P(retval_ptr)->clone_obj(retval_ptr TSRMLS_CC);
                } else if (!EG(free_op1)) { /* Not a temp var */
-                       if (PZVAL_IS_REF(retval_ptr) && retval_ptr->refcount > 
0) {
+                       if (EG(active_op_array)->return_reference == 
ZEND_RETURN_REF ||
+                           (PZVAL_IS_REF(retval_ptr) && retval_ptr->refcount > 
0)) {
                                ALLOC_ZVAL(*(EG(return_value_ptr_ptr)));
                                **EG(return_value_ptr_ptr) = *retval_ptr;
                                (*EG(return_value_ptr_ptr))->is_ref = 0;
http://cvs.php.net/diff.php/ZendEngine2/tests/bug22836.phpt?r1=1.2.2.1&r2=1.2.2.2&ty=u
Index: ZendEngine2/tests/bug22836.phpt
diff -u ZendEngine2/tests/bug22836.phpt:1.2.2.1 
ZendEngine2/tests/bug22836.phpt:1.2.2.2
--- ZendEngine2/tests/bug22836.phpt:1.2.2.1     Mon Dec 27 08:04:02 2004
+++ ZendEngine2/tests/bug22836.phpt     Fri May 27 12:05:52 2005
@@ -64,11 +64,3 @@
 Notice: Undefined variable: a in %s on line %d
 
 Strict Standards: Only variable references should be returned by reference in 
%s on line %d
-string(3) "foo"
-'foo'
-
-Notice: Undefined variable: a in %s on line %d
-
-Strict Standards: Only variable references should be returned by reference in 
%s on line %d
-
-

-- 
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>