cvs: php-src(PHP_5_1) / NEWS /ext/spl spl_iterators.c
| From: | Antony Dovgal | Date: | Fri, 12 May 2006 09:43:07 +0000 |
| Subject: | cvs: php-src(PHP_5_1) / NEWS /ext/spl spl_iterators.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-38178@lists.php.net to get a copy of this message | ||
tony2001 Fri May 12 09:43:07 2006 UTC
Modified files: (Branch: PHP_5_1)
/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.552&r2=1.2027.2.553&diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.552 php-src/NEWS:1.2027.2.553
--- php-src/NEWS:1.2027.2.552 Thu May 11 22:11:17 2006
+++ php-src/NEWS Fri May 12 09:43:07 2006
@@ -1,6 +1,8 @@
PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? ??? 2006, PHP 5.?.?
+- Fixed bug #37416 (iterator_to_array() hides exceptions thrown in rewind()
+ method). (Tony)
- Fixed bug #37392 (Unnecessary call to OCITransRollback() at the end of
request). (Tony)
- Fixed bug #37313 (sigemptyset() used without including <signal.h>).
http://cvs.php.net/viewcvs.cgi/php-src/ext/spl/spl_iterators.c?r1=1.73.2.30&r2=1.73.2.31&diff_format=u
Index: php-src/ext/spl/spl_iterators.c
diff -u php-src/ext/spl/spl_iterators.c:1.73.2.30 php-src/ext/spl/spl_iterators.c:1.73.2.31
--- php-src/ext/spl/spl_iterators.c:1.73.2.30 Thu Apr 13 13:21:43 2006
+++ php-src/ext/spl/spl_iterators.c Fri May 12 09:43:07 2006
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: spl_iterators.c,v 1.73.2.30 2006/04/13 13:21:43 tony2001 Exp $ */
+/* $Id: spl_iterators.c,v 1.73.2.31 2006/05/12 09:43:07 tony2001 Exp $ */
#ifdef HAVE_CONFIG_H
# include "config.h"
@@ -2063,11 +2063,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);
@@ -2081,8 +2090,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;
+ }
}
/* }}} */
@@ -2103,11 +2118,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);
}