Merge branch 'PHP-7.1' into PHP-7.2

This commit is contained in:
Nikita Popov 2018-01-12 21:28:10 +01:00
commit e112b8474a
3 changed files with 26 additions and 1 deletions

2
NEWS
View file

@ -10,6 +10,8 @@ PHP NEWS
. Fixed bug #75786 (segfault when using spread operator on generator passed
by reference). (Nikita)
. Fixed bug #75799 (arg of get_defined_functions is optional). (carusogabriel)
. Fixed bug #75396 (Exit inside generator finally results in fatal error).
(Nikita)
- Opcache:
. Fixed bug #75687 (var 8 (TMP) has array key type but not value type).

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

@ -185,7 +185,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;
}