Fixed stream_cast

This commit is contained in:
Xinchen Hui 2014-03-05 11:28:31 +08:00
parent 12478f7287
commit 1a828f42ea
2 changed files with 2 additions and 4 deletions

View File

@ -492,6 +492,7 @@ PHP_FUNCTION(stream_get_meta_data)
array_init(return_value);
if (!ZVAL_IS_UNDEF(&stream->wrapperdata)) {
Z_ADDREF_P(&stream->wrapperdata);
add_assoc_zval(return_value, "wrapper_data", &stream->wrapperdata);
}
if (stream->wrapper) {
@ -779,7 +780,6 @@ PHP_FUNCTION(stream_select)
FD_ZERO(&efds);
if (r_array != NULL) {
r_array = Z_REFVAL_P(r_array);
set_count = stream_array_to_fd_set(r_array, &rfds, &max_fd TSRMLS_CC);
if (set_count > max_set_count)
max_set_count = set_count;
@ -787,7 +787,6 @@ PHP_FUNCTION(stream_select)
}
if (w_array != NULL) {
w_array = Z_REFVAL_P(w_array);
set_count = stream_array_to_fd_set(w_array, &wfds, &max_fd TSRMLS_CC);
if (set_count > max_set_count)
max_set_count = set_count;
@ -795,7 +794,6 @@ PHP_FUNCTION(stream_select)
}
if (e_array != NULL) {
e_array = Z_REFVAL_P(e_array);
set_count = stream_array_to_fd_set(e_array, &efds, &max_fd TSRMLS_CC);
if (set_count > max_set_count)
max_set_count = set_count;

View File

@ -1510,7 +1510,7 @@ static int php_userstreamop_cast(php_stream *stream, int castas, void **retptr T
us->wrapper->classname);
break;
}
if (Z_TYPE(retval) != IS_UNDEF || !zend_is_true(&retval TSRMLS_CC)) {
if (ZVAL_IS_UNDEF(&retval) || !zend_is_true(&retval TSRMLS_CC)) {
break;
}
php_stream_from_zval_no_verify(intstream, &retval);