Merge branch 'PHP-7.1' into PHP-7.2

* PHP-7.1:
  Fixed bug #76367 (NoRewindIterator segfault 11)
This commit is contained in:
Xinchen Hui 2018-05-23 14:46:01 +08:00
commit dc461d6f56
2 changed files with 17 additions and 1 deletions

View File

@ -1039,7 +1039,7 @@ static zval *spl_array_it_get_current_data(zend_object_iterator *iter) /* {{{ */
return zend_user_it_get_current_data(iter);
} else {
zval *data = zend_hash_get_current_data_ex(aht, spl_array_get_pos_ptr(aht, object));
if (Z_TYPE_P(data) == IS_INDIRECT) {
if (data && Z_TYPE_P(data) == IS_INDIRECT) {
data = Z_INDIRECT_P(data);
}
return data;

View File

@ -0,0 +1,16 @@
--TEST--
Bug #76367 (NoRewindIterator segfault 11)
--FILE--
<?php
$arr = [1,3,55,66,43,6];
$iter = new NoRewindIterator(new ArrayIterator($arr));
while($iter->valid()) {
$iter->next();
}
var_dump($iter->current());
?>
--EXPECT--
NULL