mirror of
https://github.com/php/php-src.git
synced 2024-09-23 19:07:26 +00:00
Merge branch 'PHP-7.2'
This commit is contained in:
commit
d8d20020f5
22
Zend/tests/generators/bug75396.phpt
Normal file
22
Zend/tests/generators/bug75396.phpt
Normal file
@ -0,0 +1,22 @@
|
||||
--TEST--
|
||||
Bug #75396: Exit inside generator finally results in fatal error
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$gen = (function () {
|
||||
yield 42;
|
||||
|
||||
try {
|
||||
echo "Try\n";
|
||||
exit("Exit\n");
|
||||
} finally {
|
||||
echo "Finally\n";
|
||||
}
|
||||
})();
|
||||
|
||||
$gen->send("x");
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
Try
|
||||
Exit
|
@ -186,7 +186,8 @@ static void zend_generator_dtor_storage(zend_object *object) /* {{{ */
|
||||
generator->node.parent = NULL;
|
||||
}
|
||||
|
||||
if (EXPECTED(!ex) || EXPECTED(!(ex->func->op_array.fn_flags & ZEND_ACC_HAS_FINALLY_BLOCK))) {
|
||||
if (EXPECTED(!ex) || EXPECTED(!(ex->func->op_array.fn_flags & ZEND_ACC_HAS_FINALLY_BLOCK))
|
||||
|| CG(unclean_shutdown)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user