[php-src] master: Merge branch 'PHP-8.2' into PHP-8.3

From: Date: Mon, 01 Apr 2024 18:35:06 +0000
Subject: [php-src] master: Merge branch 'PHP-8.2' into PHP-8.3
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-127925@lists.php.net to get a copy of this message
Author: Niels Dossche (nielsdos) Date: 2024-04-01T20:34:37+02:00 Commit: https://github.com/php/php-src/commit/e34c86ce1a2a9cb84784baa5e0b78f0b513fd438 Raw diff: https://github.com/php/php-src/commit/e34c86ce1a2a9cb84784baa5e0b78f0b513fd438.diff Merge branch 'PHP-8.2' into PHP-8.3 * PHP-8.2: Fix gcc-14 Wcalloc-transposed-args warnings Changed paths: M NEWS M ext/ffi/ffi.c M ext/opcache/zend_accelerator_blacklist.c M ext/standard/proc_open.c M main/streams/glob_wrapper.c Diff: diff --git a/NEWS b/NEWS index aa112a314401a..f3bfccba29fdc 100644 --- a/NEWS +++ b/NEWS @@ -36,6 +36,9 @@ PHP NEWS . Fixed bug GH-13264 (Part 1 - Memory leak on stream filter failure). (Jakub Zelenka) +- Treewide: + . Fix gcc-14 Wcalloc-transposed-args warnings. (Cristian Rodríguez) + 28 Mar 2024, PHP 8.3.5RC1 - Core: diff --git a/ext/ffi/ffi.c b/ext/ffi/ffi.c index b9ae159574c7e..6258e818df29b 100644 --- a/ext/ffi/ffi.c +++ b/ext/ffi/ffi.c @@ -2160,7 +2160,7 @@ static zend_result zend_ffi_cdata_get_closure(zend_object *obj, zend_class_entry if (EXPECTED(EG(trampoline).common.function_name == NULL)) { func = &EG(trampoline); } else { - func = ecalloc(sizeof(zend_internal_function), 1); + func = ecalloc(1, sizeof(zend_internal_function)); } func->type = ZEND_INTERNAL_FUNCTION; func->common.arg_flags[0] = 0; @@ -2912,7 +2912,7 @@ static zend_function *zend_ffi_get_func(zend_object **obj, zend_string *name, co if (EXPECTED(EG(trampoline).common.function_name == NULL)) { func = &EG(trampoline); } else { - func = ecalloc(sizeof(zend_internal_function), 1); + func = ecalloc(1, sizeof(zend_internal_function)); } func->common.type = ZEND_INTERNAL_FUNCTION; func->common.arg_flags[0] = 0; diff --git a/ext/opcache/zend_accelerator_blacklist.c b/ext/opcache/zend_accelerator_blacklist.c index 8ddc9298bf4d3..c4a543e6207bb 100644 --- a/ext/opcache/zend_accelerator_blacklist.c +++ b/ext/opcache/zend_accelerator_blacklist.c @@ -58,7 +58,7 @@ void zend_accel_blacklist_init(zend_blacklist *blacklist) zend_accel_blacklist_shutdown(blacklist); } - blacklist->entries = (zend_blacklist_entry *) calloc(sizeof(zend_blacklist_entry), blacklist->size); + blacklist->entries = (zend_blacklist_entry *) calloc(blacklist->size, sizeof(zend_blacklist_entry)); if (!blacklist->entries) { zend_accel_error_noreturn(ACCEL_LOG_FATAL, "Blacklist initialization: no memory\n"); return; diff --git a/ext/standard/proc_open.c b/ext/standard/proc_open.c index 78d2db999eab6..b37cfd262906e 100644 --- a/ext/standard/proc_open.c +++ b/ext/standard/proc_open.c @@ -692,7 +692,7 @@ static zend_string* get_command_from_array(HashTable *array, char ***argv, int n static descriptorspec_item* alloc_descriptor_array(HashTable *descriptorspec) { uint32_t ndescriptors = zend_hash_num_elements(descriptorspec); - return ecalloc(sizeof(descriptorspec_item), ndescriptors); + return ecalloc(ndescriptors, sizeof(descriptorspec_item)); } static zend_string* get_string_parameter(zval *array, int index, char *param_name) diff --git a/main/streams/glob_wrapper.c b/main/streams/glob_wrapper.c index dc18964d7a8ff..66f2e8e0dfc70 100644 --- a/main/streams/glob_wrapper.c +++ b/main/streams/glob_wrapper.c @@ -226,7 +226,7 @@ static php_stream *php_glob_stream_opener(php_stream_wrapper *wrapper, const cha } } - pglob = ecalloc(sizeof(*pglob), 1); + pglob = ecalloc(1, sizeof(*pglob)); if (0 != (ret = glob(path, pglob->flags & GLOB_FLAGMASK, NULL, &pglob->glob))) { #ifdef GLOB_NOMATCH

« previous php.cvs (#127925) next »