Skip to content

Commit d22cef8

Browse files
committed
Fix [-Wmaybe-uninitialized] and [-Wduplicated-branches] in FFI
1 parent ae48ad5 commit d22cef8

File tree

3 files changed

+3
-10
lines changed

3 files changed

+3
-10
lines changed

ext/ffi/ffi.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7328,6 +7328,7 @@ void zend_ffi_val_character(zend_ffi_val *val, const char *str, size_t str_len)
73287328
n = str[3] - 'a';
73297329
} else {
73307330
val->kind = ZEND_FFI_VAL_ERROR;
7331+
return;
73317332
}
73327333
if ((str[4] >= '0' && str[4] <= '7') && str_len == 6) {
73337334
n = n * 16 + (str[4] - '0');

ext/ffi/ffi_parser.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2991,11 +2991,7 @@ static int parse_attrib(int sym, zend_ffi_dcl *dcl) {
29912991
} else {
29922992
yy_error_sym("unexpected", sym);
29932993
}
2994-
} else if (sym == YY_CONST) {
2995-
sym = get_sym();
2996-
} else if (sym == YY___CONST) {
2997-
sym = get_sym();
2998-
} else {
2994+
} else { /* sym == YY_CONST || sym == YY___CONST || something else */
29992995
sym = get_sym();
30002996
}
30012997
}

sapi/cli/php_cli_server.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1879,12 +1879,8 @@ static size_t php_cli_server_client_send_through(php_cli_server_client *client,
18791879
int nfds = php_pollfd_for(client->sock, POLLOUT, &tv);
18801880
if (nfds > 0) {
18811881
continue;
1882-
} else if (nfds < 0) {
1883-
/* error */
1884-
php_handle_aborted_connection();
1885-
return nbytes_left;
18861882
} else {
1887-
/* timeout */
1883+
/* error or timeout */
18881884
php_handle_aborted_connection();
18891885
return nbytes_left;
18901886
}

0 commit comments

Comments
 (0)