]> granicus.if.org Git - php/commitdiff
Fixed destruction of zval after returning from __call()
authorDmitry Stogov <dmitry@php.net>
Tue, 3 May 2005 12:47:27 +0000 (12:47 +0000)
committerDmitry Stogov <dmitry@php.net>
Tue, 3 May 2005 12:47:27 +0000 (12:47 +0000)
Zend/zend_object_handlers.c

index dc9a1b9106f7d687f7c61afaccca9f358a604851..738b0bae270b8e52a2d92289b085cfd02661cd7c 100644 (file)
@@ -527,7 +527,11 @@ ZEND_API void zend_std_call_user_call(INTERNAL_FUNCTION_PARAMETERS)
        zend_call_method_with_2_params(&this_ptr, ce, &ce->__call, ZEND_CALL_FUNC_NAME, &method_result_ptr, method_name_ptr, method_args_ptr);
 
        if (method_result_ptr) {
-               RETVAL_ZVAL(method_result_ptr, 0, 1);
+               if (method_result_ptr->is_ref || method_result_ptr->refcount > 1) {
+                       RETVAL_ZVAL(method_result_ptr, 1, 1);
+               } else {
+                       RETVAL_ZVAL(method_result_ptr, 0, 1);
+               }
        }
        
        /* now destruct all auxiliaries */