From c9709bfbd7a71a42e0472abaf9c7d30598e264bf Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Fri, 20 Jul 2012 00:49:50 +0200 Subject: Remove asterix modifier (*) for generators Generators are now automatically detected by the presence of a `yield` expression in their body. This removes the ZEND_SUSPEND_AND_RETURN_GENERATOR opcode. Instead additional checks for ZEND_ACC_GENERATOR are added to the fcall_common helper and zend_call_function. This also adds a new function zend_generator_create_zval, which handles the actual creation of the generator zval from an op array. I feel like I should deglobalize the zend_create_execute_data_from_op_array code a bit. It currently changes EG(current_execute_data) and EG(opline_ptr) which is somewhat confusing (given the name). --- Zend/zend_vm_opcodes.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'Zend/zend_vm_opcodes.h') diff --git a/Zend/zend_vm_opcodes.h b/Zend/zend_vm_opcodes.h index 46a711d179..87fabfc2ac 100644 --- a/Zend/zend_vm_opcodes.h +++ b/Zend/zend_vm_opcodes.h @@ -159,6 +159,5 @@ #define ZEND_SEPARATE 156 #define ZEND_QM_ASSIGN_VAR 157 #define ZEND_JMP_SET_VAR 158 -#define ZEND_SUSPEND_AND_RETURN_GENERATOR 159 -#define ZEND_YIELD 160 -#define ZEND_DELEGATE_YIELD 161 +#define ZEND_YIELD 159 +#define ZEND_DELEGATE_YIELD 160 -- cgit v1.2.1