mirror of
https://github.com/php/php-src.git
synced 2024-11-30 21:35:36 +08:00
Fix use-after-free with yield from in yield_from_multi_tree_single_nodes.phpt
Prevent release of generator children during destruction
This commit is contained in:
parent
f51bbcc2b2
commit
452f7b0d41
@ -232,7 +232,9 @@ static void zend_generator_dtor_storage(zend_object *object) /* {{{ */
|
||||
child = (zend_generator *) Z_PTR_P(zend_hash_get_current_data(generator->node.child.ht));
|
||||
}
|
||||
GC_ADD_FLAGS(&child->std, IS_OBJ_DESTRUCTOR_CALLED);
|
||||
GC_ADDREF(&child->std); /* must not be released during destructor */
|
||||
zend_generator_dtor_storage(&child->std);
|
||||
OBJ_RELEASE(&child->std);
|
||||
}
|
||||
}
|
||||
if (EXPECTED(generator->node.children == 0)) {
|
||||
|
Loading…
Reference in New Issue
Block a user