]> granicus.if.org Git - php/commitdiff
This part of the if was necessary after all.
authorZeev Suraski <zeev@php.net>
Wed, 17 Dec 2003 17:06:34 +0000 (17:06 +0000)
committerZeev Suraski <zeev@php.net>
Wed, 17 Dec 2003 17:06:34 +0000 (17:06 +0000)
Refix bug #22510

Zend/zend_execute.c

index e0f15bd8da9d4dafbe5007a922f1c2646ed3a0c2..1eb9e6e7f25b99549e119b8b2c7a7c193ddb77d7 100644 (file)
@@ -2718,10 +2718,9 @@ int zend_return_handler(ZEND_OPCODE_HANDLER_ARGS)
                        zend_error(E_ERROR, "Cannot return string offsets by reference");
                }
 
-               if (!(*retval_ptr_ptr)->is_ref
-                       /*&& EX_T(EX(opline)->op1.u.var).var.ptr_ptr == &EX_T(EX(opline)->op1.u.var).var.ptr*/) {
-                       if (EX(opline)->extended_value == ZEND_RETURNS_FUNCTION
-                               && !EX_T(EX(opline)->op1.u.var).var.fcall_returned_reference) {
+               if (!(*retval_ptr_ptr)->is_ref) {
+                       if (EX_T(EX(opline)->op1.u.var).var.ptr_ptr == &EX_T(EX(opline)->op1.u.var).var.ptr
+                               || (EX(opline)->extended_value == ZEND_RETURNS_FUNCTION && !EX_T(EX(opline)->op1.u.var).var.fcall_returned_reference)) {
                                zend_error(E_STRICT, "Only variable references should be returned by reference");
                                PZVAL_LOCK(*retval_ptr_ptr); /* undo the effect of get_zval_ptr_ptr() */
                                goto return_by_value;