Merge branch 'PHP-7.2'

This commit is contained in:
Nikita Popov 2018-01-12 21:28:31 +01:00
commit d8d20020f5
2 changed files with 24 additions and 1 deletions

View 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

View File

@ -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;
}