Skip to content

Commit 3457037

Browse files
committed
Use RETURN_THROWS() during ZPP in most of the extensions
Except for some bigger ones: reflection, sodium, spl
1 parent d9ac1ca commit 3457037

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+1001
-994
lines changed

ext/iconv/iconv.c

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2002,7 +2002,7 @@ PHP_FUNCTION(iconv_strlen)
20022002

20032003
if (zend_parse_parameters(ZEND_NUM_ARGS(), "S|s",
20042004
&str, &charset, &charset_len) == FAILURE) {
2005-
return;
2005+
RETURN_THROWS();
20062006
}
20072007

20082008
if (charset_len >= ICONV_CSNMAXLEN) {
@@ -2037,7 +2037,7 @@ PHP_FUNCTION(iconv_substr)
20372037
if (zend_parse_parameters(ZEND_NUM_ARGS(), "Sl|l!s",
20382038
&str, &offset, &length, &len_is_null,
20392039
&charset, &charset_len) == FAILURE) {
2040-
return;
2040+
RETURN_THROWS();
20412041
}
20422042

20432043
if (charset_len >= ICONV_CSNMAXLEN) {
@@ -2077,7 +2077,7 @@ PHP_FUNCTION(iconv_strpos)
20772077
if (zend_parse_parameters(ZEND_NUM_ARGS(), "SS|ls",
20782078
&haystk, &ndl,
20792079
&offset, &charset, &charset_len) == FAILURE) {
2080-
return;
2080+
RETURN_THROWS();
20812081
}
20822082

20832083
if (charset_len >= ICONV_CSNMAXLEN) {
@@ -2131,7 +2131,7 @@ PHP_FUNCTION(iconv_strrpos)
21312131
if (zend_parse_parameters(ZEND_NUM_ARGS(), "SS|s",
21322132
&haystk, &ndl,
21332133
&charset, &charset_len) == FAILURE) {
2134-
return;
2134+
RETURN_THROWS();
21352135
}
21362136

21372137
if (ZSTR_LEN(ndl) < 1) {
@@ -2176,7 +2176,7 @@ PHP_FUNCTION(iconv_mime_encode)
21762176
&field_name, &field_value,
21772177
&pref) == FAILURE) {
21782178

2179-
return;
2179+
RETURN_THROWS();
21802180
}
21812181

21822182
if (pref != NULL) {
@@ -2274,7 +2274,7 @@ PHP_FUNCTION(iconv_mime_decode)
22742274
if (zend_parse_parameters(ZEND_NUM_ARGS(), "S|ls",
22752275
&encoded_str, &mode, &charset, &charset_len) == FAILURE) {
22762276

2277-
return;
2277+
RETURN_THROWS();
22782278
}
22792279

22802280
if (charset_len >= ICONV_CSNMAXLEN) {
@@ -2314,7 +2314,7 @@ PHP_FUNCTION(iconv_mime_decode_headers)
23142314
if (zend_parse_parameters(ZEND_NUM_ARGS(), "S|ls",
23152315
&encoded_str, &mode, &charset, &charset_len) == FAILURE) {
23162316

2317-
return;
2317+
RETURN_THROWS();
23182318
}
23192319

23202320
if (charset_len >= ICONV_CSNMAXLEN) {
@@ -2407,8 +2407,9 @@ PHP_NAMED_FUNCTION(php_if_iconv)
24072407
zend_string *out_buffer;
24082408

24092409
if (zend_parse_parameters(ZEND_NUM_ARGS(), "ssS",
2410-
&in_charset, &in_charset_len, &out_charset, &out_charset_len, &in_buffer) == FAILURE)
2411-
return;
2410+
&in_charset, &in_charset_len, &out_charset, &out_charset_len, &in_buffer) == FAILURE) {
2411+
RETURN_THROWS();
2412+
}
24122413

24132414
if (in_charset_len >= ICONV_CSNMAXLEN || out_charset_len >= ICONV_CSNMAXLEN) {
24142415
php_error_docref(NULL, E_WARNING, "Charset parameter exceeds the maximum allowed length of %d characters", ICONV_CSNMAXLEN);
@@ -2473,8 +2474,9 @@ PHP_FUNCTION(iconv_get_encoding)
24732474
char *type = "all";
24742475
size_t type_len = sizeof("all")-1;
24752476

2476-
if (zend_parse_parameters(ZEND_NUM_ARGS(), "|s", &type, &type_len) == FAILURE)
2477-
return;
2477+
if (zend_parse_parameters(ZEND_NUM_ARGS(), "|s", &type, &type_len) == FAILURE) {
2478+
RETURN_THROWS();
2479+
}
24782480

24792481
if (!strcasecmp("all", type)) {
24802482
array_init(return_value);

0 commit comments

Comments
 (0)