summaryrefslogtreecommitdiff
path: root/ext/standard/array.c
diff options
context:
space:
mode:
authorChristopher Jones <sixd@php.net>2013-07-22 10:58:57 -0700
committerChristopher Jones <sixd@php.net>2013-07-22 10:58:57 -0700
commita1bf38e075ce7d6bbcbcf570444f13ea7558fa41 (patch)
treeaa492ea45da770d6e6db85dba336945a02765739 /ext/standard/array.c
parentc7ee677f2f330bbcc8721b6a84dd3a05dc0c5541 (diff)
parent25f924abf62e70f3474b5885c12a521c68c2066d (diff)
downloadphp-git-a1bf38e075ce7d6bbcbcf570444f13ea7558fa41.tar.gz
Merge branch 'PHP-5.4' of https://git.php.net/repository/php-src into PHP-5.4
# By Anatol Belski (8) and others # Via Anatol Belski (2) and others * 'PHP-5.4' of https://git.php.net/repository/php-src: (44 commits) fixed possible null deref - addressed bug #65159, Misleading configure help text for --with-mysql-sock Update news for FILTER_SANITIZE_FULL_SPECIAL_CHARS fix Wrong value for FILTER_SANITIZE_FULL_SPECIAL_CHARS in REGISTER_LONG_CONSTANT Fixed bug #65304 (Use of max int in array_sum) Reorder NEWS Fixed bug #65291 - get_defined_constants() crash with __CLASS__ in trait Fixed bug #65291 - get_defined_constants() crash with __CLASS__ in trait Properly fixed bug #63186 on NetBSD == 6.0 Improve php.ini-* documentation 5.4.19 is next Fixed bug #50308 - session id not appended properly for empty anchor tags Fix bug #62129 - rfc1867 crashes php even though turned off add news for xml fix fix TS build added sapi check for dl() test Make zval2myslqnd implementations aware of inheritance Fixed typo ensuring header str is \0 terminated fix buffer overrun fix invalid variable name at ext/spl/internal/multipleiterator.inc (key() method, too) ...
Diffstat (limited to 'ext/standard/array.c')
-rw-r--r--ext/standard/array.c18
1 files changed, 4 insertions, 14 deletions
diff --git a/ext/standard/array.c b/ext/standard/array.c
index 40a27c0536..0eaca16618 100644
--- a/ext/standard/array.c
+++ b/ext/standard/array.c
@@ -352,7 +352,7 @@ PHP_FUNCTION(count)
/* Numbers are always smaller than strings int this function as it
* anyway doesn't make much sense to compare two different data types.
- * This keeps it consistant and simple.
+ * This keeps it consistent and simple.
*
* This is not correct any more, depends on what compare_func is set to.
*/
@@ -1053,7 +1053,7 @@ PHP_FUNCTION(max)
static int php_array_walk(HashTable *target_hash, zval *userdata, int recursive TSRMLS_DC) /* {{{ */
{
zval **args[3], /* Arguments to userland function */
- *retval_ptr, /* Return value - unused */
+ *retval_ptr = NULL, /* Return value - unused */
*key=NULL; /* Entry key */
char *string_key;
uint string_key_len;
@@ -2877,7 +2877,7 @@ static int zval_compare(zval **a, zval **b TSRMLS_DC) /* {{{ */
static int zval_user_compare(zval **a, zval **b TSRMLS_DC) /* {{{ */
{
zval **args[2];
- zval *retval_ptr;
+ zval *retval_ptr = NULL;
args[0] = (zval **) a;
args[1] = (zval **) b;
@@ -4037,17 +4037,7 @@ PHP_FUNCTION(array_sum)
entry_n = **entry;
zval_copy_ctor(&entry_n);
convert_scalar_to_number(&entry_n TSRMLS_CC);
-
- if (Z_TYPE(entry_n) == IS_LONG && Z_TYPE_P(return_value) == IS_LONG) {
- dval = (double)Z_LVAL_P(return_value) + (double)Z_LVAL(entry_n);
- if ( (double)LONG_MIN <= dval && dval <= (double)LONG_MAX ) {
- Z_LVAL_P(return_value) += Z_LVAL(entry_n);
- continue;
- }
- }
- convert_to_double(return_value);
- convert_to_double(&entry_n);
- Z_DVAL_P(return_value) += Z_DVAL(entry_n);
+ fast_add_function(return_value, return_value, &entry_n TSRMLS_CC);
}
}
/* }}} */