Skip to content

Commit

Permalink
Fix typo in RecursiveIteratorIterator get_gc handler
Browse files Browse the repository at this point in the history
  • Loading branch information
nikic committed Jul 2, 2021
1 parent b653802 commit c2a8934
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion ext/spl/spl_iterators.c
Original file line number Diff line number Diff line change
Expand Up @@ -928,7 +928,7 @@ static HashTable *spl_RecursiveIteratorIterator_get_gc(zend_object *obj, zval **
if (object->iterators) {
for (int level = 0; level <= object->level; level++) {
zend_get_gc_buffer_add_zval(gc_buffer, &object->iterators[level].zobject);
zend_get_gc_buffer_add_obj(gc_buffer, &object->iterators[object->level].iterator->std);
zend_get_gc_buffer_add_obj(gc_buffer, &object->iterators[level].iterator->std);
}
}

Expand Down
6 changes: 6 additions & 0 deletions ext/spl/tests/bug65387.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,12 @@ $it = new RecursiveArrayIterator([1, 2, 3]);
$it2 = new RecursiveIteratorIterator($it);
$it[] = $it2;

// Recursive iterator at level>0.
$it = new RecursiveArrayIterator([[1]]);
$it2 = new RecursiveIteratorIterator($it);
$it[] = $it2;
$it2->next();

?>
===DONE===
--EXPECT--
Expand Down

0 comments on commit c2a8934

Please sign in to comment.