Bug #75396 [Opn->Csd]: Exit inside generator finally results in fatal error

From: Date: Fri, 12 Jan 2018 20:28:57 +0000
Subject: Bug #75396 [Opn->Csd]: Exit inside generator finally results in fatal error
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-213511@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 Updated by: nikic@php.net Reported by: kelunik@php.net Summary: Exit inside generator finally results in fatal error -Status: Open +Status: Closed Type: Bug Package: Scripting Engine problem PHP Version: 7.2.0RC4 Block user comment: N Private report: N New Comment: Automatic comment on behalf of nikita.ppv@gmail.com Revision: http://git.php.net/?p=php-src.git;a=commit;h=420d11e8caf8dc76e08984dfed3a4322295a1208 Log: Fixed bug #75396 Previous Comments: ------------------------------------------------------------------------ [2018-01-11 09:39:41] kelunik@php.net This seems to also affect generators without finally. https://github.com/kelunik/acme-client/commit/56955155feab5c473b7281d06ee46e735f915bcd ------------------------------------------------------------------------ [2017-11-06 10:38:12] bashofmann at gmail dot com Maybe something like this is also the root cause for the segfault here https://bugs.php.net/bug.php?id=75351 ------------------------------------------------------------------------ [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

« previous php.bugs (#213511) next »