com php-src: Use inlined version of zval_ptr_dtor() i n array_map() loop: ext/standard/array.c

From: Date: Thu, 29 Jun 2017 09:15:57 +0000
Subject: com php-src: Use inlined version of zval_ptr_dtor() i n array_map() loop: ext/standard/array.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-98246@lists.php.net to get a copy of this message
Commit: 5a51da9942d8e901bdeff2fab97f9aa010cda03a Author: Dmitry Stogov <dmitry@zend.com> Thu, 29 Jun 2017 12:15:57 +0300 Parents: e111bccd48377798aee38fa94fc22cd374b3980b Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=5a51da9942d8e901bdeff2fab97f9aa010cda03a Log: Use inlined version of zval_ptr_dtor() in array_map() loop Changed paths: M ext/standard/array.c Diff: diff --git a/ext/standard/array.c b/ext/standard/array.c index ab34ac4..d6ea5c4 100644 --- a/ext/standard/array.c +++ b/ext/standard/array.c @@ -6024,6 +6024,7 @@ PHP_FUNCTION(array_map) zend_ulong num_key; zend_string *str_key; zval *zv, arg; + int ret; if (Z_TYPE(arrays[0]) != IS_ARRAY) { php_error_docref(NULL, E_WARNING, "Argument #%d should be an array", 2); @@ -6046,13 +6047,11 @@ PHP_FUNCTION(array_map) fci.no_separation = 0; ZVAL_COPY(&arg, zv); - - if (zend_call_function(&fci, &fci_cache) != SUCCESS || Z_TYPE(result) == IS_UNDEF) { - zval_dtor(return_value); - zval_ptr_dtor(&arg); + ret = zend_call_function(&fci, &fci_cache); + i_zval_ptr_dtor(&arg ZEND_FILE_LINE_CC); + if (ret != SUCCESS || Z_TYPE(result) == IS_UNDEF) { + zend_array_destroy(Z_ARR_P(return_value)); RETURN_NULL(); - } else { - zval_ptr_dtor(&arg); } if (str_key) { zend_hash_add_new(Z_ARRVAL_P(return_value), str_key, &result); @@ -6136,7 +6135,7 @@ PHP_FUNCTION(array_map) if (zend_call_function(&fci, &fci_cache) != SUCCESS || Z_TYPE(result) == IS_UNDEF) { efree(array_pos); - zval_dtor(return_value); + zend_array_destroy(Z_ARR_P(return_value)); for (i = 0; i < n_arrays; i++) { zval_ptr_dtor(&params[i]); }

« previous php.cvs (#98246) next »