]> granicus.if.org Git - php/commitdiff
Fixed assignment of reference to itself
authorDmitry Stogov <dmitry@zend.com>
Thu, 14 Aug 2014 08:01:28 +0000 (12:01 +0400)
committerDmitry Stogov <dmitry@zend.com>
Thu, 14 Aug 2014 08:01:28 +0000 (12:01 +0400)
Zend/zend_execute.c

index 700ce4b090c5bef2859db85656b4fea2d8709fac..f3e97d71d057edf628ae0ec0280054388e4cc2b9 100644 (file)
@@ -933,6 +933,9 @@ static inline zval* zend_assign_to_variable(zval *variable_ptr, zval *value TSRM
                                                value = Z_REFVAL_P(value);
                                        }
                                        if (Z_REFCOUNTED_P(value)) {
+                                               if (UNEXPECTED(variable_ptr == value)) {
+                                                       return variable_ptr;
+                                               }
                                                Z_ADDREF_P(value);
                                        }
                                }