Bug #75396 [Com]: Exit inside generator finally results in fatal error
| From: | bashofmann at gmail dot com | Date: | Mon, 06 Nov 2017 10:38:15 +0000 |
| Subject: | Bug #75396 [Com]: Exit inside generator finally results in fatal error | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-212477@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=75396&edit=1
ID: 75396
Comment by: bashofmann at gmail dot com
Reported by: kelunik@php.net
Summary: Exit inside generator finally results in fatal error
Status: Open
Type: Bug
Package: Scripting Engine problem
PHP Version: 7.2.0RC4
Block user comment: N
Private report: N
New Comment:
Maybe something like this is also the root cause for the segfault here https://bugs.php.net/bug.php?id=75351
Previous Comments:
------------------------------------------------------------------------
[2017-10-17 08:18:23] kelunik@php.net
Description:
------------
See example. It doesn't continue the generator anywhere, it just exists.
Test script:
---------------
<?php
$gen = (function () {
yield 42;
try {
} finally {
exit;
}
})();
$gen->send("x");
Expected result:
----------------
Clean exit.
Actual result:
--------------
Fatal error: Cannot resume an already running generator.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=75396&edit=1