From 1d0a4b2fe74eb46fe7cb08361432b9d3e64f08f1 Mon Sep 17 00:00:00 2001 From: Antony Dovgal Date: Fri, 13 Jul 2007 08:50:53 +0000 Subject: [PATCH] simplify the patch and prevent NULL retval_ptr_ptr's --- ext/standard/basic_functions.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c index d90cba2479..5b5413761f 100644 --- a/ext/standard/basic_functions.c +++ b/ext/standard/basic_functions.c @@ -5042,10 +5042,8 @@ PHP_FUNCTION(call_user_func) fci.retval_ptr_ptr = &retval_ptr; - if (zend_call_function(&fci, &fci_cache TSRMLS_CC) == SUCCESS) { - *return_value = **fci.retval_ptr_ptr; - zval_copy_ctor(return_value); - zval_ptr_dtor(fci.retval_ptr_ptr); + if (zend_call_function(&fci, &fci_cache TSRMLS_CC) == SUCCESS && fci.retval_ptr_ptr && *fci.retval_ptr_ptr) { + COPY_PZVAL_TO_ZVAL(*return_value, *fci.retval_ptr_ptr); } if (fci.params) { @@ -5069,10 +5067,8 @@ PHP_FUNCTION(call_user_func_array) zend_fcall_info_args(&fci, params TSRMLS_CC); fci.retval_ptr_ptr = &retval_ptr; - if (zend_call_function(&fci, &fci_cache TSRMLS_CC) == SUCCESS) { - *return_value = **fci.retval_ptr_ptr; - zval_copy_ctor(return_value); - zval_ptr_dtor(fci.retval_ptr_ptr); + if (zend_call_function(&fci, &fci_cache TSRMLS_CC) == SUCCESS && fci.retval_ptr_ptr && *fci.retval_ptr_ptr) { + COPY_PZVAL_TO_ZVAL(*return_value, *fci.retval_ptr_ptr); } zend_fcall_info_args_clear(&fci, 1); -- 2.50.1