Skip to content

Commit

Permalink
Change implicit enum return value checks to explicit checks (#10703)
Browse files Browse the repository at this point in the history
  • Loading branch information
nielsdos committed Feb 26, 2023
1 parent f0cfebc commit 375e740
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion ext/opcache/ZendAccelerator.c
Expand Up @@ -4014,7 +4014,7 @@ static void preload_link(void)
zend_error_at(
E_WARNING, ce->info.user.filename, ce->info.user.line_start,
"Can't preload already declared class %s", ZSTR_VAL(ce->name));
} else if (preload_resolve_deps(&error, ce)) {
} else if (preload_resolve_deps(&error, ce) == FAILURE) {
zend_error_at(
E_WARNING, ce->info.user.filename, ce->info.user.line_start,
"Can't preload unlinked class %s: %s%s",
Expand Down
12 changes: 6 additions & 6 deletions ext/standard/filters.c
Expand Up @@ -1187,15 +1187,15 @@ static php_conv *php_conv_open(int conv_mode, const HashTable *options, int pers
}
retval = pemalloc(sizeof(php_conv_base64_encode), persistent);
if (lbchars != NULL) {
if (php_conv_base64_encode_ctor((php_conv_base64_encode *)retval, line_len, lbchars, lbchars_len, 1, persistent)) {
if (php_conv_base64_encode_ctor((php_conv_base64_encode *)retval, line_len, lbchars, lbchars_len, 1, persistent) != PHP_CONV_ERR_SUCCESS) {
if (lbchars != NULL) {
pefree(lbchars, 0);
}
goto out_failure;
}
pefree(lbchars, 0);
} else {
if (php_conv_base64_encode_ctor((php_conv_base64_encode *)retval, 0, NULL, 0, 0, persistent)) {
if (php_conv_base64_encode_ctor((php_conv_base64_encode *)retval, 0, NULL, 0, 0, persistent) != PHP_CONV_ERR_SUCCESS) {
goto out_failure;
}
}
Expand Down Expand Up @@ -1239,13 +1239,13 @@ static php_conv *php_conv_open(int conv_mode, const HashTable *options, int pers
}
retval = pemalloc(sizeof(php_conv_qprint_encode), persistent);
if (lbchars != NULL) {
if (php_conv_qprint_encode_ctor((php_conv_qprint_encode *)retval, line_len, lbchars, lbchars_len, 1, opts, persistent)) {
if (php_conv_qprint_encode_ctor((php_conv_qprint_encode *)retval, line_len, lbchars, lbchars_len, 1, opts, persistent) != PHP_CONV_ERR_SUCCESS) {
pefree(lbchars, 0);
goto out_failure;
}
pefree(lbchars, 0);
} else {
if (php_conv_qprint_encode_ctor((php_conv_qprint_encode *)retval, 0, NULL, 0, 0, opts, persistent)) {
if (php_conv_qprint_encode_ctor((php_conv_qprint_encode *)retval, 0, NULL, 0, 0, opts, persistent) != PHP_CONV_ERR_SUCCESS) {
goto out_failure;
}
}
Expand All @@ -1262,13 +1262,13 @@ static php_conv *php_conv_open(int conv_mode, const HashTable *options, int pers

retval = pemalloc(sizeof(php_conv_qprint_decode), persistent);
if (lbchars != NULL) {
if (php_conv_qprint_decode_ctor((php_conv_qprint_decode *)retval, lbchars, lbchars_len, 1, persistent)) {
if (php_conv_qprint_decode_ctor((php_conv_qprint_decode *)retval, lbchars, lbchars_len, 1, persistent) != PHP_CONV_ERR_SUCCESS) {
pefree(lbchars, 0);
goto out_failure;
}
pefree(lbchars, 0);
} else {
if (php_conv_qprint_decode_ctor((php_conv_qprint_decode *)retval, NULL, 0, 0, persistent)) {
if (php_conv_qprint_decode_ctor((php_conv_qprint_decode *)retval, NULL, 0, 0, persistent) != PHP_CONV_ERR_SUCCESS) {
goto out_failure;
}
}
Expand Down

0 comments on commit 375e740

Please sign in to comment.