From: Xinchen Hui Date: Sat, 24 May 2014 13:37:15 +0000 (+0800) Subject: fci->retval is always set X-Git-Tag: POST_PHPNG_MERGE~300 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b87cff66b871177c50317ede21cdd1c93250d28a;p=php fci->retval is always set --- diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c index 15f79738e6..9459344df6 100644 --- a/Zend/zend_execute_API.c +++ b/Zend/zend_execute_API.c @@ -857,10 +857,10 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache TS EG(active_op_array) = (zend_op_array *) EX(function_state).function; original_opline_ptr = EG(opline_ptr); - if (EG(active_op_array)->fn_flags & ZEND_ACC_GENERATOR) { - zend_generator_create_zval(EG(active_op_array), fci->retval TSRMLS_CC); - } else { + if (EXPECTED((EG(active_op_array)->fn_flags & ZEND_ACC_GENERATOR) == 0)) { zend_execute(EG(active_op_array), fci->retval TSRMLS_CC); + } else { + zend_generator_create_zval(EG(active_op_array), fci->retval TSRMLS_CC); } EG(active_op_array) = original_op_array; @@ -885,9 +885,9 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache TS because it can break proper ones (Bug #34045) if (!EX(function_state).function->common.return_reference) { - INIT_PZVAL(*fci->retval_ptr_ptr); + INIT_PZVAL(*f); }*/ - if (EG(exception) && fci->retval) { + if (EG(exception)) { zval_ptr_dtor(fci->retval); ZVAL_UNDEF(fci->retval); } @@ -911,7 +911,7 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache TS } efree(EX(function_state).function); - if (EG(exception) && fci->retval) { + if (EG(exception)) { zval_ptr_dtor(fci->retval); ZVAL_UNDEF(fci->retval); }