From: Anatol Belski Date: Tue, 16 Sep 2014 19:06:22 +0000 (+0200) Subject: fix signed/unsigned mismatch X-Git-Tag: POST_NATIVE_TLS_MERGE^2~251 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8c4ab0d02edd1cd6f353ce9e411cd43f726ed441;p=php fix signed/unsigned mismatch --- diff --git a/ext/standard/array.c b/ext/standard/array.c index 09aaddfbf5..a417925528 100644 --- a/ext/standard/array.c +++ b/ext/standard/array.c @@ -1528,7 +1528,7 @@ static void php_compact_var(HashTable *eg_active_symbol_table, zval *return_valu PHP_FUNCTION(compact) { zval *args = NULL; /* function arguments array */ - int num_args, i; + uint32_t num_args, i; zend_array *symbol_table; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "+", &args, &num_args) == FAILURE) { @@ -2085,7 +2085,7 @@ static void _phpi_pop(INTERNAL_FUNCTION_PARAMETERS, int off_the_end) zend_hash_rehash(Z_ARRVAL_P(stack)); } } - } else if (!key && Z_ARRVAL_P(stack)->nNextFreeElement > 0 && index >= Z_ARRVAL_P(stack)->nNextFreeElement - 1) { + } else if (!key && Z_ARRVAL_P(stack)->nNextFreeElement > 0 && index >= (zend_ulong)(Z_ARRVAL_P(stack)->nNextFreeElement - 1)) { Z_ARRVAL_P(stack)->nNextFreeElement = Z_ARRVAL_P(stack)->nNextFreeElement - 1; } @@ -3174,7 +3174,7 @@ static void php_array_intersect(INTERNAL_FUNCTION_PARAMETERS, int behavior, int int arr_argc, i, c = 0; uint idx; Bucket **lists, *list, **ptrs, *p; - int req_args; + uint32_t req_args; char *param_spec; zend_fcall_info fci1, fci2; zend_fcall_info_cache fci1_cache = empty_fcall_info_cache, fci2_cache = empty_fcall_info_cache; @@ -3598,7 +3598,7 @@ static void php_array_diff(INTERNAL_FUNCTION_PARAMETERS, int behavior, int data_ int arr_argc, i, c; uint idx; Bucket **lists, *list, **ptrs, *p; - int req_args; + uint32_t req_args; char *param_spec; zend_fcall_info fci1, fci2; zend_fcall_info_cache fci1_cache = empty_fcall_info_cache, fci2_cache = empty_fcall_info_cache; @@ -4423,7 +4423,8 @@ PHP_FUNCTION(array_map) zval result; zend_fcall_info fci = empty_fcall_info; zend_fcall_info_cache fci_cache = empty_fcall_info_cache; - int i, k, maxlen = 0; + int i; + uint32_t k, maxlen = 0; #ifndef FAST_ZPP if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "f!+", &fci, &fci_cache, &arrays, &n_arrays) == FAILURE) {