]> granicus.if.org Git - php/commitdiff
Fixed refcounting
authorXinchen Hui <laruence@gmail.com>
Sun, 2 Mar 2014 07:15:51 +0000 (15:15 +0800)
committerXinchen Hui <laruence@gmail.com>
Sun, 2 Mar 2014 07:15:51 +0000 (15:15 +0800)
ext/reflection/php_reflection.c

index 45a719e64b768680ca840eabbeac4a0339876db6..d2583621e3a592c4206cc09c4a7bcb979f176362 100644 (file)
@@ -5038,7 +5038,9 @@ ZEND_METHOD(reflection_property, setValue)
                                
                                ZVAL_COPY_VALUE(&garbage, variable_ptr);
                                /* if we assign referenced variable, we should separate it */
-                               Z_ADDREF_P(value);
+                               if (Z_REFCOUNTED_P(value)) {
+                                       Z_ADDREF_P(value);
+                               }
                                if (Z_ISREF_P(value)) {
                                        SEPARATE_ZVAL(value);
                                }