From 69326a796e6e805097836d73b05424671f86c098 Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Tue, 3 May 2005 12:47:27 +0000 Subject: [PATCH] Fixed destruction of zval after returning from __call() --- Zend/zend_object_handlers.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Zend/zend_object_handlers.c b/Zend/zend_object_handlers.c index dc9a1b9106..738b0bae27 100644 --- a/Zend/zend_object_handlers.c +++ b/Zend/zend_object_handlers.c @@ -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 */ -- 2.50.1