Bug #74840 [Asn->Csd]: Opcache overwrites argument of GENERATOR_RETURN within finally
| From: | bwoebi@php.net | Date: | Sat, 01 Jul 2017 09:52:25 +0000 |
| Subject: | Bug #74840 [Asn->Csd]: Opcache overwrites argument of GENERATOR_RETURN within finally | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-209759@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=74840&edit=1
ID: 74840
Updated by: bwoebi@php.net
Reported by: bwoebi@php.net
Summary: Opcache overwrites argument of GENERATOR_RETURN
within finally
-Status: Assigned
+Status: Closed
Type: Bug
Package: opcache
Operating System: Irrelevant
PHP Version: master-Git-2017-07-01 (Git)
Assigned To: bwoebi
Block user comment: N
Private report: N
New Comment:
Automatic comment on behalf of bobwei9@hotmail.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=e3cc15daf2abc1b4886d4888c3bf5ca9cef035c8
Log: Fixed bug #74840 (Opcache overwrites argument of GENERATOR_RETURN within finally)
Previous Comments:
------------------------------------------------------------------------
[2017-07-01 09:41:42] bwoebi@php.net
Description:
------------
Within generators, the temporary argument of GENERATOR_RETURN is ignored while reindexing
temporaries in a finally block.
This leads to illegal reuse of a still live temporary and will leak/doubly use the temporary value
returned by the generator.
Test script:
---------------
<?php
$g = (function($a) {
try {
return $a + 1;
} finally {
$b = $a + 2;
var_dump($b);
}
yield; // Generator
})(1);
$g->next();
var_dump($g->getReturn());
Expected result:
----------------
int(3)
int(2)
Actual result:
--------------
int(3)
int(3)
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=74840&edit=1