Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/test-suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -413,10 +413,15 @@ jobs:
with:
enableOpcache: true
jitType: tracing
- name: Generate coverage report
if: ${{ !cancelled() }}
run: make gcovr-xml
- uses: codecov/codecov-action@v5
if: ${{ !cancelled() }}
with:
disable_search: true
fail_ci_if_error: true
files: gcovr.xml
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true
COMMUNITY:
Expand Down
10 changes: 5 additions & 5 deletions Zend/zend_API.c
Original file line number Diff line number Diff line change
Expand Up @@ -4031,7 +4031,7 @@ static zend_always_inline bool zend_is_callable_check_func(const zval *callable,
}
/* }}} */

ZEND_API zend_string *zend_get_callable_name_ex(zval *callable, const zend_object *object) /* {{{ */
ZEND_API zend_string *zend_get_callable_name_ex(const zval *callable, const zend_object *object) /* {{{ */
{
try_again:
switch (Z_TYPE_P(callable)) {
Expand Down Expand Up @@ -4089,7 +4089,7 @@ ZEND_API zend_string *zend_get_callable_name_ex(zval *callable, const zend_objec
}
/* }}} */

ZEND_API zend_string *zend_get_callable_name(zval *callable) /* {{{ */
ZEND_API zend_string *zend_get_callable_name(const zval *callable) /* {{{ */
{
return zend_get_callable_name_ex(callable, NULL);
}
Expand Down Expand Up @@ -4206,7 +4206,7 @@ ZEND_API bool zend_is_callable_at_frame(
}
/* }}} */

ZEND_API bool zend_is_callable_ex(zval *callable, zend_object *object, uint32_t check_flags, zend_string **callable_name, zend_fcall_info_cache *fcc, char **error) /* {{{ */
ZEND_API bool zend_is_callable_ex(const zval *callable, zend_object *object, uint32_t check_flags, zend_string **callable_name, zend_fcall_info_cache *fcc, char **error) /* {{{ */
{
/* Determine callability at the first parent user frame. */
const zend_execute_data *frame = EG(current_execute_data);
Expand All @@ -4221,13 +4221,13 @@ ZEND_API bool zend_is_callable_ex(zval *callable, zend_object *object, uint32_t
return ret;
}

ZEND_API bool zend_is_callable(zval *callable, uint32_t check_flags, zend_string **callable_name) /* {{{ */
ZEND_API bool zend_is_callable(const zval *callable, uint32_t check_flags, zend_string **callable_name) /* {{{ */
{
return zend_is_callable_ex(callable, NULL, check_flags, callable_name, NULL, NULL);
}
/* }}} */

ZEND_API zend_result zend_fcall_info_init(zval *callable, uint32_t check_flags, zend_fcall_info *fci, zend_fcall_info_cache *fcc, zend_string **callable_name, char **error) /* {{{ */
ZEND_API zend_result zend_fcall_info_init(const zval *callable, uint32_t check_flags, zend_fcall_info *fci, zend_fcall_info_cache *fcc, zend_string **callable_name, char **error) /* {{{ */
{
if (!zend_is_callable_ex(callable, NULL, check_flags, callable_name, fcc, error)) {
return FAILURE;
Expand Down
12 changes: 6 additions & 6 deletions Zend/zend_API.h
Original file line number Diff line number Diff line change
Expand Up @@ -410,13 +410,13 @@ ZEND_API ZEND_COLD void zend_wrong_property_read(const zval *object, zval *prope
#define IS_CALLABLE_SUPPRESS_DEPRECATIONS (1<<1)

ZEND_API void zend_release_fcall_info_cache(zend_fcall_info_cache *fcc);
ZEND_API zend_string *zend_get_callable_name_ex(zval *callable, const zend_object *object);
ZEND_API zend_string *zend_get_callable_name(zval *callable);
ZEND_API zend_string *zend_get_callable_name_ex(const zval *callable, const zend_object *object);
ZEND_API zend_string *zend_get_callable_name(const zval *callable);
ZEND_API bool zend_is_callable_at_frame(
const zval *callable, zend_object *object, const zend_execute_data *frame,
uint32_t check_flags, zend_fcall_info_cache *fcc, char **error);
ZEND_API bool zend_is_callable_ex(zval *callable, zend_object *object, uint32_t check_flags, zend_string **callable_name, zend_fcall_info_cache *fcc, char **error);
ZEND_API bool zend_is_callable(zval *callable, uint32_t check_flags, zend_string **callable_name);
ZEND_API bool zend_is_callable_ex(const zval *callable, zend_object *object, uint32_t check_flags, zend_string **callable_name, zend_fcall_info_cache *fcc, char **error);
ZEND_API bool zend_is_callable(const zval *callable, uint32_t check_flags, zend_string **callable_name);
ZEND_API const char *zend_get_module_version(const char *module_name);
ZEND_API zend_result zend_get_module_started(const char *module_name);

Expand Down Expand Up @@ -701,7 +701,7 @@ ZEND_API zend_result _call_user_function_impl(zval *object, zval *function_name,
* fci->params = NULL;
* The callable_name argument may be NULL.
*/
ZEND_API zend_result zend_fcall_info_init(zval *callable, uint32_t check_flags, zend_fcall_info *fci, zend_fcall_info_cache *fcc, zend_string **callable_name, char **error);
ZEND_API zend_result zend_fcall_info_init(const zval *callable, uint32_t check_flags, zend_fcall_info *fci, zend_fcall_info_cache *fcc, zend_string **callable_name, char **error);

/** Clear arguments connected with zend_fcall_info *fci
* If free_mem is not zero then the params array gets free'd as well
Expand Down Expand Up @@ -2482,7 +2482,7 @@ static zend_always_inline bool zend_parse_arg_resource(zval *arg, zval **dest, b
return 1;
}

static zend_always_inline bool zend_parse_arg_func(zval *arg, zend_fcall_info *dest_fci, zend_fcall_info_cache *dest_fcc, bool check_null, char **error, bool free_trampoline)
static zend_always_inline bool zend_parse_arg_func(const zval *arg, zend_fcall_info *dest_fci, zend_fcall_info_cache *dest_fcc, bool check_null, char **error, bool free_trampoline)
{
if (check_null && UNEXPECTED(Z_TYPE_P(arg) == IS_NULL)) {
dest_fci->size = 0;
Expand Down
10 changes: 7 additions & 3 deletions build/Makefile.gcov
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,12 @@ GCOVR_EXCLUDES = \
'ext/fileinfo/libmagic/.*' \
'ext/gd/libgd/.*' \
'ext/hash/sha3/.*' \
'ext/lexbor/lexbor/.*' \
'ext/mbstring/libmbfl/.*' \
'ext/pcre/pcre2lib/.*'
'ext/pcre/pcre2lib/.*' \
'ext/uri/uriparser/.*'

GCOVR_EXCLUDE_LINES_BY_PATTERN = '.*\b(ZEND_PARSE_PARAMETERS_(START|END|NONE)|Z_PARAM_).*'

lcov: lcov-html

Expand All @@ -49,14 +53,14 @@ gcovr-html:
@rm -rf gcovr_html/
@mkdir gcovr_html
gcovr -sr . -o gcovr_html/index.html --html --html-details \
--exclude-directories 'ext/date/lib$$' \
--exclude-lines-by-pattern $(GCOVR_EXCLUDE_LINES_BY_PATTERN) \
$(foreach lib, $(GCOVR_EXCLUDES), -e $(lib))

gcovr-xml:
@echo "Generating gcovr XML"
@rm -f gcovr.xml
gcovr -sr . -o gcovr.xml --xml \
--exclude-directories 'ext/date/lib$$' \
--exclude-lines-by-pattern $(GCOVR_EXCLUDE_LINES_BY_PATTERN) \
$(foreach lib, $(GCOVR_EXCLUDES), -e $(lib))

.PHONY: gcovr-html lcov-html php_lcov.info
15 changes: 0 additions & 15 deletions codecov.yml

This file was deleted.

56 changes: 25 additions & 31 deletions ext/mbstring/mbstring.c
Original file line number Diff line number Diff line change
Expand Up @@ -1216,17 +1216,17 @@ PHP_FUNCTION(mb_language)
ZEND_PARSE_PARAMETERS_END();

if (name == NULL) {
RETVAL_STRING((char *)mbfl_no_language2name(MBSTRG(language)));
RETVAL_STRING(mbfl_no_language2name(MBSTRG(language)));
} else {
zend_string *ini_name = ZSTR_INIT_LITERAL("mbstring.language", 0);
zend_string *ini_name = ZSTR_INIT_LITERAL("mbstring.language", false);
if (FAILURE == zend_alter_ini_entry(ini_name, name, PHP_INI_USER, PHP_INI_STAGE_RUNTIME)) {
zend_argument_value_error(1, "must be a valid language, \"%s\" given", ZSTR_VAL(name));
zend_string_release_ex(ini_name, 0);
zend_string_release_ex(ini_name, false);
RETURN_THROWS();
}
// TODO Make return void
RETVAL_TRUE;
zend_string_release_ex(ini_name, 0);
zend_string_release_ex(ini_name, false);
}
}
/* }}} */
Expand Down Expand Up @@ -1509,7 +1509,7 @@ PHP_FUNCTION(mb_preferred_mime_name)
php_error_docref(NULL, E_WARNING, "No MIME preferred name corresponding to \"%s\"", name);
RETVAL_FALSE;
} else {
RETVAL_STRING((char *)preferred_name);
RETVAL_STRING(preferred_name);
}
}
/* }}} */
Expand Down Expand Up @@ -3517,7 +3517,7 @@ PHP_FUNCTION(mb_detect_encoding)
RETURN_FALSE;
}

RETVAL_STRING((char *)ret->name);
RETVAL_STRING(ret->name);
}
/* }}} */

Expand Down Expand Up @@ -3563,7 +3563,7 @@ PHP_FUNCTION(mb_encoding_aliases)
array_init(return_value);
if (encoding->aliases != NULL) {
for (const char **alias = encoding->aliases; *alias; ++alias) {
add_next_index_string(return_value, (char *)*alias);
add_next_index_string(return_value, *alias);
}
}
}
Expand Down Expand Up @@ -4768,7 +4768,7 @@ PHP_FUNCTION(mb_send_mail)

str_headers = smart_str_extract(&str);

zend_string *force_extra_parameters = zend_ini_str_ex("mail.force_extra_parameters", strlen("mail.force_extra_parameters"), false, NULL);
zend_string *force_extra_parameters = zend_ini_str_literal("mail.force_extra_parameters");
if (force_extra_parameters) {
extra_cmd = php_escape_shell_cmd(force_extra_parameters);
} else if (extra_cmd) {
Expand Down Expand Up @@ -4804,7 +4804,7 @@ PHP_FUNCTION(mb_get_info)
{
zend_string *type = NULL;
size_t n;
char *name;
const char *name;
zval row;
const mbfl_encoding **entry;
const mbfl_language *lang = mbfl_no2language(MBSTRG(language));
Expand All @@ -4819,26 +4819,26 @@ PHP_FUNCTION(mb_get_info)
if (!type || zend_string_equals_literal_ci(type, "all")) {
array_init(return_value);
if (MBSTRG(current_internal_encoding)) {
add_assoc_string(return_value, "internal_encoding", (char *)MBSTRG(current_internal_encoding)->name);
add_assoc_string(return_value, "internal_encoding", MBSTRG(current_internal_encoding)->name);
}
if (MBSTRG(http_input_identify)) {
add_assoc_string(return_value, "http_input", (char *)MBSTRG(http_input_identify)->name);
add_assoc_string(return_value, "http_input", MBSTRG(http_input_identify)->name);
}
if (MBSTRG(current_http_output_encoding)) {
add_assoc_string(return_value, "http_output", (char *)MBSTRG(current_http_output_encoding)->name);
add_assoc_string(return_value, "http_output", MBSTRG(current_http_output_encoding)->name);
}

add_assoc_str(return_value, "http_output_conv_mimetypes",
zend_ini_str("mbstring.http_output_conv_mimetypes", sizeof("mbstring.http_output_conv_mimetypes") - 1, 0)
zend_string_copy(zend_ini_str_literal("mbstring.http_output_conv_mimetypes"))
);

name = (char *)mbfl_no_encoding2name(lang->mail_charset);
name = mbfl_no_encoding2name(lang->mail_charset);
add_assoc_string(return_value, "mail_charset", name);

name = (char *)mbfl_no_encoding2name(lang->mail_header_encoding);
name = mbfl_no_encoding2name(lang->mail_header_encoding);
add_assoc_string(return_value, "mail_header_encoding", name);

name = (char *)mbfl_no_encoding2name(lang->mail_body_encoding);
name = mbfl_no_encoding2name(lang->mail_body_encoding);
add_assoc_string(return_value, "mail_body_encoding", name);

add_assoc_long(return_value, "illegal_chars", MBSTRG(illegalchars));
Expand All @@ -4849,7 +4849,7 @@ PHP_FUNCTION(mb_get_info)
add_assoc_string(return_value, "encoding_translation", "Off");
}

name = (char *)mbfl_no_language2name(MBSTRG(language));
name = mbfl_no_language2name(MBSTRG(language));
add_assoc_string(return_value, "language", name);

// TODO Seems to always have one entry at least?
Expand Down Expand Up @@ -4880,31 +4880,25 @@ PHP_FUNCTION(mb_get_info)
}
} else if (zend_string_equals_literal_ci(type, "internal_encoding")) {
ZEND_ASSERT(MBSTRG(current_internal_encoding));
RETURN_STRING((char *)MBSTRG(current_internal_encoding)->name);
RETURN_STRING(MBSTRG(current_internal_encoding)->name);
} else if (zend_string_equals_literal_ci(type, "http_input")) {
if (MBSTRG(http_input_identify)) {
RETURN_STRING((char *)MBSTRG(http_input_identify)->name);
RETURN_STRING(MBSTRG(http_input_identify)->name);
}
RETURN_NULL();
} else if (zend_string_equals_literal_ci(type, "http_output")) {
ZEND_ASSERT(MBSTRG(current_http_output_encoding));
RETURN_STRING((char *)MBSTRG(current_http_output_encoding)->name);
RETURN_STRING(MBSTRG(current_http_output_encoding)->name);
} else if (zend_string_equals_literal_ci(type, "http_output_conv_mimetypes")) {
RETURN_STR(
zend_ini_str(
"mbstring.http_output_conv_mimetypes",
sizeof("mbstring.http_output_conv_mimetypes") - 1,
false
)
);
RETURN_STR_COPY(zend_ini_str_literal("mbstring.http_output_conv_mimetypes"));
} else if (zend_string_equals_literal_ci(type, "mail_charset")) {
name = (char *)mbfl_no_encoding2name(lang->mail_charset);
name = mbfl_no_encoding2name(lang->mail_charset);
RETURN_STRING(name);
} else if (zend_string_equals_literal_ci(type, "mail_header_encoding")) {
name = (char *)mbfl_no_encoding2name(lang->mail_header_encoding);
name = mbfl_no_encoding2name(lang->mail_header_encoding);
RETURN_STRING(name);
} else if (zend_string_equals_literal_ci(type, "mail_body_encoding")) {
name = (char *)mbfl_no_encoding2name(lang->mail_body_encoding);
name = mbfl_no_encoding2name(lang->mail_body_encoding);
RETURN_STRING(name);
} else if (zend_string_equals_literal_ci(type, "illegal_chars")) {
RETURN_LONG(MBSTRG(illegalchars));
Expand All @@ -4915,7 +4909,7 @@ PHP_FUNCTION(mb_get_info)
RETURN_STRING("Off");
}
} else if (zend_string_equals_literal_ci(type, "language")) {
name = (char *)mbfl_no_language2name(MBSTRG(language));
name = mbfl_no_language2name(MBSTRG(language));
RETURN_STRING(name);
} else if (zend_string_equals_literal_ci(type, "detect_order")) {
// TODO Seems to always have one entry at least?
Expand Down
Loading