php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #71441 Typehinted Generator with return in try/finally crashes
Submitted: 2016-01-24 18:47 UTC Modified: 2016-01-24 18:52 UTC
From: bwoebi@php.net Assigned: bwoebi (profile)
Status: Closed Package: Reproducible crash
PHP Version: 7.0.3RC1 OS: Irrelevant
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: bwoebi@php.net
New email:
PHP Version: OS:

 

 [2016-01-24 18:47 UTC] bwoebi@php.net
Description:
------------
Returns in try/finally in Generators with typehint modify the FAST_CALL opcode (which is next to VERIFY_RETURN), hence it crashes (or may behave strangely if executed).

Test script:
---------------
function (): \Generator {
        try {
                $foo = 1;
                return yield $foo;
        } finally {
                print "Ok\n";
        }
};


Expected result:
----------------
No crash / normal behavior


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-01-24 18:52 UTC] bwoebi@php.net
-Status: Open +Status: Assigned -Assigned To: +Assigned To: bwoebi
 [2016-01-24 18:55 UTC] bwoebi@php.net
Automatic comment on behalf of bobwei9@hotmail.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=001ce475ee158cbf020755f1f65aade28caafd73
Log: Fixed bug #71441 (Typehinted Generator with return in try/finally crashes)
 [2016-01-24 18:55 UTC] bwoebi@php.net
-Status: Assigned +Status: Closed
 [2016-01-24 18:55 UTC] bwoebi@php.net
Automatic comment on behalf of bobwei9@hotmail.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=001ce475ee158cbf020755f1f65aade28caafd73
Log: Fixed bug #71441 (Typehinted Generator with return in try/finally crashes)
 [2016-07-20 11:33 UTC] davey@php.net
Automatic comment on behalf of bobwei9@hotmail.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=001ce475ee158cbf020755f1f65aade28caafd73
Log: Fixed bug #71441 (Typehinted Generator with return in try/finally crashes)
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 03:01:27 2024 UTC