mirror of
https://github.com/php/php-src.git
synced 2025-08-16 14:08:47 +02:00
Merge branch 'PHP-7.2'
This commit is contained in:
commit
d8d20020f5
2 changed files with 24 additions and 1 deletions
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;
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue