mirror of
https://github.com/php/php-src.git
synced 2024-09-23 10:57:26 +00:00
Merge branch 'PHP-7.1'
This commit is contained in:
commit
2304bc2aa2
21
Zend/tests/bug74840.phpt
Normal file
21
Zend/tests/bug74840.phpt
Normal file
@ -0,0 +1,21 @@
|
||||
--TEST--
|
||||
Bug #74840: Opcache overwrites argument of GENERATOR_RETURN within finally
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$g = (function($a) {
|
||||
try {
|
||||
return $a + 1;
|
||||
} finally {
|
||||
$b = $a + 2;
|
||||
var_dump($b);
|
||||
}
|
||||
yield; // Generator
|
||||
})(1);
|
||||
$g->next();
|
||||
var_dump($g->getReturn());
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
int(3)
|
||||
int(2)
|
@ -109,6 +109,7 @@ void zend_optimize_temporary_variables(zend_op_array *op_array, zend_optimizer_c
|
||||
*/
|
||||
if ((op_array->fn_flags & ZEND_ACC_HAS_FINALLY_BLOCK) &&
|
||||
(opline->opcode == ZEND_RETURN ||
|
||||
opline->opcode == ZEND_GENERATOR_RETURN ||
|
||||
opline->opcode == ZEND_RETURN_BY_REF ||
|
||||
opline->opcode == ZEND_FREE ||
|
||||
opline->opcode == ZEND_FE_FREE)) {
|
||||
|
Loading…
Reference in New Issue
Block a user