Skip to content

Commit 7b4a4d2

Browse files
committed
Use RETURN_THROWS() after try_convert_to_string()
1 parent 1658b5b commit 7b4a4d2

File tree

17 files changed

+30
-30
lines changed

17 files changed

+30
-30
lines changed

ext/exif/exif.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4434,7 +4434,7 @@ PHP_FUNCTION(exif_read_data)
44344434
ret = exif_read_from_stream(&ImageInfo, p_stream, read_thumbnail, read_all);
44354435
} else {
44364436
if (!try_convert_to_string(stream)) {
4437-
return;
4437+
RETURN_THROWS();
44384438
}
44394439

44404440
if (!Z_STRLEN_P(stream)) {
@@ -4607,7 +4607,7 @@ PHP_FUNCTION(exif_thumbnail)
46074607
ret = exif_read_from_stream(&ImageInfo, p_stream, 1, 0);
46084608
} else {
46094609
if (!try_convert_to_string(stream)) {
4610-
return;
4610+
RETURN_THROWS();
46114611
}
46124612

46134613
if (!Z_STRLEN_P(stream)) {

ext/imap/php_imap.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1693,7 +1693,7 @@ PHP_FUNCTION(imap_delete)
16931693
}
16941694

16951695
if (!try_convert_to_string(sequence)) {
1696-
return;
1696+
RETURN_THROWS();
16971697
}
16981698

16991699
mail_setflag_full(imap_le_struct->imap_stream, Z_STRVAL_P(sequence), "\\DELETED", (argc == 3 ? flags : NIL));
@@ -1719,7 +1719,7 @@ PHP_FUNCTION(imap_undelete)
17191719
}
17201720

17211721
if (!try_convert_to_string(sequence)) {
1722-
return;
1722+
RETURN_THROWS();
17231723
}
17241724

17251725
mail_clearflag_full(imap_le_struct->imap_stream, Z_STRVAL_P(sequence), "\\DELETED", (argc == 3 ? flags : NIL));
@@ -2140,7 +2140,7 @@ PHP_FUNCTION(imap_savebody)
21402140

21412141
default:
21422142
if (!try_convert_to_string(out)) {
2143-
return;
2143+
RETURN_THROWS();
21442144
}
21452145
writer = php_stream_open_wrapper(Z_STRVAL_P(out), "wb", REPORT_ERRORS, NULL);
21462146
break;

ext/intl/dateformat/dateformat_format_object.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ U_CFUNC PHP_FUNCTION(datefmt_format_object)
141141
dateStyle = timeStyle = (DateFormat::EStyle)Z_LVAL_P(format);
142142
} else {
143143
if (!try_convert_to_string(format)) {
144-
return;
144+
RETURN_THROWS();
145145
}
146146
if (Z_STRLEN_P(format) == 0) {
147147
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,

ext/intl/timezone/timezone_methods.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ U_CFUNC PHP_FUNCTION(intltz_create_enumeration)
164164
zend_long lval;
165165
double dval;
166166
if (!try_convert_to_string(arg)) {
167-
return;
167+
RETURN_THROWS();
168168
}
169169
switch (is_numeric_string(Z_STRVAL_P(arg), Z_STRLEN_P(arg), &lval, &dval, 0)) {
170170
case IS_DOUBLE:

ext/intl/transliterator/transliterator_methods.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ PHP_FUNCTION( transliterator_transliterate )
316316
{ /* not a transliterator object as first argument */
317317
int res;
318318
if( !try_convert_to_string( arg1 ) ) {
319-
return;
319+
RETURN_THROWS();
320320
}
321321
object = &tmp_object;
322322
res = create_transliterator( Z_STRVAL_P( arg1 ), Z_STRLEN_P( arg1 ),

ext/mbstring/mbstring.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1600,7 +1600,7 @@ PHP_FUNCTION(mb_detect_order)
16001600
break;
16011601
default:
16021602
if (!try_convert_to_string(arg1)) {
1603-
return;
1603+
RETURN_THROWS();
16041604
}
16051605
if (FAILURE == php_mb_parse_encoding_list(Z_STRVAL_P(arg1), Z_STRLEN_P(arg1), &list, &size, 0)) {
16061606
if (list) {
@@ -2878,7 +2878,7 @@ PHP_FUNCTION(mb_convert_encoding)
28782878

28792879
if (Z_TYPE_P(input) != IS_STRING && Z_TYPE_P(input) != IS_ARRAY) {
28802880
if (!try_convert_to_string(input)) {
2881-
return;
2881+
RETURN_THROWS();
28822882
}
28832883
}
28842884

@@ -2917,7 +2917,7 @@ PHP_FUNCTION(mb_convert_encoding)
29172917
break;
29182918
default:
29192919
if (!try_convert_to_string(arg_old)) {
2920-
return;
2920+
RETURN_THROWS();
29212921
}
29222922

29232923
_from_encodings = Z_STRVAL_P(arg_old);
@@ -3096,7 +3096,7 @@ PHP_FUNCTION(mb_detect_encoding)
30963096
break;
30973097
default:
30983098
if (!try_convert_to_string(encoding_list)) {
3099-
return;
3099+
RETURN_THROWS();
31003100
}
31013101
if (FAILURE == php_mb_parse_encoding_list(Z_STRVAL_P(encoding_list), Z_STRLEN_P(encoding_list), &list, &size, 0)) {
31023102
if (list) {
@@ -3507,7 +3507,7 @@ PHP_FUNCTION(mb_convert_variables)
35073507
break;
35083508
default:
35093509
if (!try_convert_to_string(zfrom_enc)) {
3510-
return;
3510+
RETURN_THROWS();
35113511
}
35123512
php_mb_parse_encoding_list(Z_STRVAL_P(zfrom_enc), Z_STRLEN_P(zfrom_enc), &elist, &elistsz, 0);
35133513
break;
@@ -4464,7 +4464,7 @@ PHP_FUNCTION(mb_check_encoding)
44644464
}
44654465
} else {
44664466
if (!try_convert_to_string(input)) {
4467-
RETURN_FALSE;
4467+
RETURN_THROWS();
44684468
}
44694469
if (!php_mb_check_encoding(Z_STRVAL_P(input), Z_STRLEN_P(input), enc ? ZSTR_VAL(enc): NULL)) {
44704470
RETURN_FALSE;

ext/mysqli/mysqli_api.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -898,7 +898,7 @@ PHP_FUNCTION(mysqli_stmt_execute)
898898
switch (stmt->stmt->params[i].buffer_type) {
899899
case MYSQL_TYPE_VAR_STRING:
900900
if (!try_convert_to_string(param)) {
901-
return;
901+
RETURN_THROWS();
902902
}
903903

904904
stmt->stmt->params[i].buffer = Z_STRVAL_P(param);
@@ -1791,7 +1791,7 @@ PHP_FUNCTION(mysqli_options)
17911791
switch (expected_type) {
17921792
case IS_STRING:
17931793
if (!try_convert_to_string(mysql_value)) {
1794-
return;
1794+
RETURN_THROWS();
17951795
}
17961796
break;
17971797
case IS_LONG:

ext/odbc/php_odbc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1095,7 +1095,7 @@ PHP_FUNCTION(odbc_execute)
10951095
}
10961096
}
10971097
efree(params);
1098-
RETURN_FALSE;
1098+
RETURN_THROWS();
10991099
}
11001100

11011101
params[i-1].vallen = Z_STRLEN_P(tmp);

ext/pcntl/pcntl.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -862,7 +862,7 @@ PHP_FUNCTION(pcntl_exec)
862862
if (argi >= argc) break;
863863
if (!try_convert_to_string(element)) {
864864
efree(argv);
865-
return;
865+
RETURN_THROWS();
866866
}
867867

868868
*current_arg = Z_STRVAL_P(element);
@@ -895,7 +895,7 @@ PHP_FUNCTION(pcntl_exec)
895895
zend_string_release(key);
896896
efree(argv);
897897
efree(envp);
898-
return;
898+
RETURN_THROWS();
899899
}
900900

901901
/* Length of element + equal sign + length of key + null */

ext/pdo_pgsql/pgsql_driver.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -592,7 +592,7 @@ static PHP_METHOD(PDO, pgsqlCopyFromArray)
592592
size_t query_len;
593593
if (!try_convert_to_string(tmp)) {
594594
efree(query);
595-
return;
595+
RETURN_THROWS();
596596
}
597597

598598
if (buffer_len < Z_STRLEN_P(tmp)) {

0 commit comments

Comments
 (0)