Fixed bug #72523 (dtrace issue with reflection (failed test))

This commit is contained in:
Xinchen Hui 2016-07-01 18:50:35 +08:00
parent acdafc0a27
commit d1dd474ff9
4 changed files with 22 additions and 2 deletions

1
NEWS
View File

@ -3,6 +3,7 @@ PHP NEWS
?? ??? 2016, PHP 7.1.0beta1
- Core:
. Fixed bug #72523 (dtrace issue with reflection (failed test)). (Laruence)
. Fixed bug #72508 (strange references after recursive function call and
"switch" statement). (Laruence)

View File

@ -0,0 +1,15 @@
--TEST--
Bug #72523 (dtrace issue with reflection (failed test))
--FILE--
<?php
$gen = (new class() {
function a() {
yield "okey";
}
})->a();
var_dump($gen->current());
?>
--EXPECT--
string(4) "okey"

View File

@ -4046,7 +4046,9 @@ ZEND_VM_HANDLER(41, ZEND_GENERATOR_CREATE, ANY, ANY)
gen_execute_data->return_value = (zval*)generator;
call_info = Z_TYPE_INFO(EX(This));
if ((call_info & Z_TYPE_MASK) == IS_OBJECT
&& !(call_info & ((ZEND_CALL_CLOSURE|ZEND_CALL_RELEASE_THIS) << ZEND_CALL_INFO_SHIFT))) {
&& (!(call_info & ((ZEND_CALL_CLOSURE|ZEND_CALL_RELEASE_THIS) << ZEND_CALL_INFO_SHIFT))
/* Bug #72523 */
|| UNEXPECTED(zend_execute_ex != execute_ex))) {
ZEND_ADD_CALL_FLAG_EX(call_info, ZEND_CALL_RELEASE_THIS);
Z_ADDREF(gen_execute_data->This);
}

View File

@ -1205,7 +1205,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_GENERATOR_CREATE_SPEC_HANDLER(
gen_execute_data->return_value = (zval*)generator;
call_info = Z_TYPE_INFO(EX(This));
if ((call_info & Z_TYPE_MASK) == IS_OBJECT
&& !(call_info & ((ZEND_CALL_CLOSURE|ZEND_CALL_RELEASE_THIS) << ZEND_CALL_INFO_SHIFT))) {
&& (!(call_info & ((ZEND_CALL_CLOSURE|ZEND_CALL_RELEASE_THIS) << ZEND_CALL_INFO_SHIFT))
/* Bug #72523 */
|| UNEXPECTED(zend_execute_ex != execute_ex))) {
ZEND_ADD_CALL_FLAG_EX(call_info, ZEND_CALL_RELEASE_THIS);
Z_ADDREF(gen_execute_data->This);
}