com php-src: Merge branch 'PHP-5.6' into PHP-7.0: ext/spl/spl _directory.c
| From: | Stanislav Malyshev | Date: | Mon, 19 Oct 2015 00:20:00 +0000 |
| Subject: | com php-src: Merge branch 'PHP-5.6' into PHP-7.0: ext/spl/spl _directory.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-89454@lists.php.net to get a copy of this message | ||
Commit: 26e5429f721b40d6d721fa9e2e2ede5f6222798c
Author: Stanislav Malyshev <stas@php.net> Sun, 18 Oct 2015 17:20:00 -0700
Parents: 307c1f6bf0e8e3c97416b2a22ed54dd4546ea689 0b35e0c5a120c9ff98dad7e44259f26ca828a8e4
Branches: PHP-7.0 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=26e5429f721b40d6d721fa9e2e2ede5f6222798c
Log:
Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
Fix bug #64172
Bug #70561: Fix DirectoryIterator to throw OutOfBoundsException
Conflicts:
ext/pdo/pdo_dbh.c
Bugs:
https://bugs.php.net/64172
https://bugs.php.net/70561
Changed paths:
MM ext/spl/spl_directory.c
Diff:
diff --cc ext/spl/spl_directory.c
index 5090a0b,7fb4ecd..a330ac4
--- a/ext/spl/spl_directory.c
+++ b/ext/spl/spl_directory.c
@@@ -828,15 -838,20 +828,16 @@@ SPL_METHOD(DirectoryIterator, seek
while (intern->u.dir.index < pos) {
int valid = 0;
- zend_call_method_with_0_params(&this_ptr, Z_OBJCE_P(getThis()),
&intern->u.dir.func_valid, "valid", &retval);
- if (retval) {
- valid = zend_is_true(retval);
+ zend_call_method_with_0_params(&EX(This), Z_OBJCE(EX(This)),
&intern->u.dir.func_valid, "valid", &retval);
+ if (!Z_ISUNDEF(retval)) {
+ valid = zend_is_true(&retval);
zval_ptr_dtor(&retval);
- retval = NULL;
}
if (!valid) {
- break;
+ zend_throw_exception_ex(spl_ce_OutOfBoundsException, 0 TSRMLS_CC, "Seek position %ld is
out of range", pos);
+ return;
}
- zend_call_method_with_0_params(&this_ptr, Z_OBJCE_P(getThis()),
&intern->u.dir.func_next, "next", &retval);
- if (retval) {
- zval_ptr_dtor(&retval);
- }
+ zend_call_method_with_0_params(&EX(This), Z_OBJCE(EX(This)),
&intern->u.dir.func_next, "next", NULL);
}
} /* }}} */