mirror of
https://github.com/php/php-src.git
synced 2024-11-24 10:24:11 +08:00
Fixed bug #72523 (dtrace issue with reflection (failed test))
This commit is contained in:
parent
acdafc0a27
commit
d1dd474ff9
1
NEWS
1
NEWS
@ -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)
|
||||
|
||||
|
15
Zend/tests/generators/bug72523.phpt
Normal file
15
Zend/tests/generators/bug72523.phpt
Normal 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"
|
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user