cvs: php-src(PHP_5_2) / NEWS /ext/spl spl_iterators.c

From: Date: Fri, 12 May 2006 09:42:56 +0000
Subject: cvs: php-src(PHP_5_2) / NEWS /ext/spl spl_iterators.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-38177@lists.php.net to get a copy of this message
tony2001 Fri May 12 09:42:56 2006 UTC Modified files: (Branch: PHP_5_2) /php-src NEWS /php-src/ext/spl spl_iterators.c Log: MFH: fix #37416 (iterator_to_array() hides exceptions thrown in rewind() method) http://cvs.php.net/viewcvs.cgi/php-src/NEWS?r1=1.2027.2.547.2.16&r2=1.2027.2.547.2.17&diff_format=u Index: php-src/NEWS diff -u php-src/NEWS:1.2027.2.547.2.16 php-src/NEWS:1.2027.2.547.2.17 --- php-src/NEWS:1.2027.2.547.2.16 Thu May 11 22:58:14 2006 +++ php-src/NEWS Fri May 12 09:42:56 2006 @@ -19,6 +19,8 @@ - Added support for Apache 2.2 handler in the Windows distro. (Edin) - Added pg_field_table() function. (Edin) - Add implementation of curl_multi_info_read (Brian) +- Fixed bug #37416 (iterator_to_array() hides exceptions thrown in rewind() + method). (Tony) - Fixed bug #37413 (Rejected versions of flex that don't work). (Ilia) - Fixed bug #37394 (substr_compare() returns an error when offset equals string length). (Ilia) http://cvs.php.net/viewcvs.cgi/php-src/ext/spl/spl_iterators.c?r1=1.73.2.30.2.3&r2=1.73.2.30.2.4&diff_format=u Index: php-src/ext/spl/spl_iterators.c diff -u php-src/ext/spl/spl_iterators.c:1.73.2.30.2.3 php-src/ext/spl/spl_iterators.c:1.73.2.30.2.4 --- php-src/ext/spl/spl_iterators.c:1.73.2.30.2.3 Wed May 10 16:50:57 2006 +++ php-src/ext/spl/spl_iterators.c Fri May 12 09:42:56 2006 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: spl_iterators.c,v 1.73.2.30.2.3 2006/05/10 16:50:57 andrei Exp $ */ +/* $Id: spl_iterators.c,v 1.73.2.30.2.4 2006/05/12 09:42:56 tony2001 Exp $ */ #ifdef HAVE_CONFIG_H # include "config.h" @@ -2395,11 +2395,20 @@ if (iter->funcs->rewind) { iter->funcs->rewind(iter TSRMLS_CC); } + if (EG(exception)) { + return; + } while (iter->funcs->valid(iter TSRMLS_CC) == SUCCESS) { iter->funcs->get_current_data(iter, &data TSRMLS_CC); + if (EG(exception)) { + return; + } (*data)->refcount++; if (iter->funcs->get_current_key) { key_type = iter->funcs->get_current_key(iter, &str_key, &str_key_len, &int_key TSRMLS_CC); + if (EG(exception)) { + return; + } switch(key_type) { case HASH_KEY_IS_STRING: add_assoc_zval_ex(return_value, str_key, str_key_len, *data); @@ -2413,8 +2422,14 @@ add_next_index_zval(return_value, *data); } iter->funcs->move_forward(iter TSRMLS_CC); + if (EG(exception)) { + return; + } } iter->funcs->dtor(iter TSRMLS_CC); + if (EG(exception)) { + return; + } } /* }}} */ @@ -2435,11 +2450,23 @@ if (iter->funcs->rewind) { iter->funcs->rewind(iter TSRMLS_CC); } + if (EG(exception)) { + return; + } while (iter->funcs->valid(iter TSRMLS_CC) == SUCCESS) { + if (EG(exception)) { + return; + } count++; iter->funcs->move_forward(iter TSRMLS_CC); + if (EG(exception)) { + return; + } } iter->funcs->dtor(iter TSRMLS_CC); + if (EG(exception)) { + return; + } RETURN_LONG(count); }

« previous php.cvs (#38177) next »