From dda96a9a5f61112834d7ec059154e423fa0676de Mon Sep 17 00:00:00 2001 From: Ivan Shalganov Date: Tue, 11 Dec 2012 16:11:37 +0400 Subject: [PATCH 1/6] add: test for rise --- Zend/tests/generators/rise_exception.phpt | 29 +++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 Zend/tests/generators/rise_exception.phpt diff --git a/Zend/tests/generators/rise_exception.phpt b/Zend/tests/generators/rise_exception.phpt new file mode 100644 index 000000000000..02945690d085 --- /dev/null +++ b/Zend/tests/generators/rise_exception.phpt @@ -0,0 +1,29 @@ +--TEST-- +Rise exception in the generator +--FILE-- +getMessage()); + } + var_dump(yield "yield bar"); +} + +$gen = gen(); +var_dump($gen->current()); +$gen->rise(new Exception("rise exception")); +var_dump($gen->current()); +$gen->send("send foo"); + +?> +--EXPECT-- +string(15) "start generator" +string(9) "yield foo" +string(14) "rise exception" +string(9) "yield bar" +string(8) "send foo" From 792f951f42899a8aae5fcd7303cc2ae04ad12995 Mon Sep 17 00:00:00 2001 From: Ivan Shalganov Date: Tue, 11 Dec 2012 16:28:08 +0400 Subject: [PATCH 2/6] add: Generator::rise() --- Zend/zend_generators.c | 47 ++++++++++++++++++++++++++++++++++++++++++ Zend/zend_generators.h | 5 ++++- Zend/zend_vm_def.h | 11 +++++++++- 3 files changed, 61 insertions(+), 2 deletions(-) diff --git a/Zend/zend_generators.c b/Zend/zend_generators.c index dc7ae1479b41..b653d916def7 100644 --- a/Zend/zend_generators.c +++ b/Zend/zend_generators.c @@ -451,6 +451,11 @@ void zend_generator_resume(zend_generator *generator TSRMLS_DC) /* {{{ */ * set the prev_execute_data of that prev_execute_data :) */ generator->execute_data->prev_execute_data->prev_execute_data = original_execute_data; + if(generator->exception) { + EG(exception) = generator->exception; + generator->exception = NULL; + } + /* Resume execution */ generator->flags |= ZEND_GENERATOR_CURRENTLY_RUNNING; zend_execute_ex(generator->execute_data TSRMLS_CC); @@ -623,6 +628,43 @@ ZEND_METHOD(Generator, send) } /* }}} */ +/* {{{ proto mixed Generator::rise() + * Throws exceptions into the generator */ +ZEND_METHOD(Generator, rise) +{ + zval *exc; + zend_generator *generator; + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &exc) == FAILURE) { + return; + } + + generator = (zend_generator *) zend_object_store_get_object(getThis() TSRMLS_CC); + + zend_generator_ensure_initialized(generator TSRMLS_CC); + + /* The generator is already closed, thus can't send anything */ + if (!generator->execute_data) { + return; + } + + /* The sent value was initialized to NULL, so dtor that */ + /*zval_ptr_dtor(&generator->send_target->var.ptr); + + Z_ADDREF_P(exc); + generator->send_target->var.ptr = exc; + generator->send_target->var.ptr_ptr = &exc; + generator->flags |= ZEND_GENERATOR_RISE_EXCEPTION;*/ + Z_ADDREF_P(exc); + generator->exception = exc; + + zend_generator_resume(generator TSRMLS_CC); + + if (generator->value) { + RETURN_ZVAL(generator->value, 1, 0); + } +} +/* }}} */ + /* {{{ proto void Generator::__wakeup() * Throws an Exception as generators can't be serialized */ ZEND_METHOD(Generator, __wakeup) @@ -764,6 +806,10 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_generator_send, 0, 0, 1) ZEND_ARG_INFO(0, value) ZEND_END_ARG_INFO() +ZEND_BEGIN_ARG_INFO_EX(arginfo_generator_rise, 0, 0, 1) + ZEND_ARG_INFO(0, exception) +ZEND_END_ARG_INFO() + static const zend_function_entry generator_functions[] = { ZEND_ME(Generator, rewind, arginfo_generator_void, ZEND_ACC_PUBLIC) ZEND_ME(Generator, valid, arginfo_generator_void, ZEND_ACC_PUBLIC) @@ -771,6 +817,7 @@ static const zend_function_entry generator_functions[] = { ZEND_ME(Generator, key, arginfo_generator_void, ZEND_ACC_PUBLIC) ZEND_ME(Generator, next, arginfo_generator_void, ZEND_ACC_PUBLIC) ZEND_ME(Generator, send, arginfo_generator_send, ZEND_ACC_PUBLIC) + ZEND_ME(Generator, rise, arginfo_generator_rise, ZEND_ACC_PUBLIC) ZEND_ME(Generator, __wakeup, arginfo_generator_void, ZEND_ACC_PUBLIC) ZEND_FE_END }; diff --git a/Zend/zend_generators.h b/Zend/zend_generators.h index 90f8160f710b..61f33d64e5e9 100644 --- a/Zend/zend_generators.h +++ b/Zend/zend_generators.h @@ -43,11 +43,13 @@ typedef struct _zend_generator { /* The separate stack used by generator */ zend_vm_stack stack; - + /* Current value */ zval *value; /* Current key */ zval *key; + + zval *exception; /* Variable to put sent value into */ temp_variable *send_target; /* Largest used integer key for auto-incrementing keys */ @@ -60,6 +62,7 @@ typedef struct _zend_generator { static const zend_uchar ZEND_GENERATOR_CURRENTLY_RUNNING = 0x1; static const zend_uchar ZEND_GENERATOR_FORCED_CLOSE = 0x2; static const zend_uchar ZEND_GENERATOR_AT_FIRST_YIELD = 0x4; +static const zend_uchar ZEND_GENERATOR_RISE_EXCEPTION = 0x8; void zend_register_generator_ce(TSRMLS_D); zval *zend_generator_create_zval(zend_op_array *op_array TSRMLS_DC); diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h index edbffe12c990..1895972faee7 100644 --- a/Zend/zend_vm_def.h +++ b/Zend/zend_vm_def.h @@ -5395,21 +5395,30 @@ ZEND_VM_HANDLER(160, ZEND_YIELD, CONST|TMP|VAR|CV|UNUSED, CONST|TMP|VAR|CV|UNUSE ZVAL_LONG(generator->key, generator->largest_used_integer_key); } + + if (UNEXPECTED(EG(exception) != NULL)) { + //zval_ptr_dtor(&EX_T(opline->result.var).var.ptr); + HANDLE_EXCEPTION(); + ZEND_VM_RETURN(); + } /* If a value is sent it should go into the result var */ generator->send_target = &EX_T(opline->result.var); + /* Initialize the sent value to NULL */ Z_ADDREF(EG(uninitialized_zval)); AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); + CHECK_EXCEPTION(); + /* We increment to the next op, so we are at the correct position when the * generator is resumed. */ ZEND_VM_INC_OPCODE(); + //ZEND_VM_CONTINUE(); /* The GOTO VM uses a local opline variable. We need to set the opline * variable in execute_data so we don't resume at an old position. */ SAVE_OPLINE(); - ZEND_VM_RETURN(); } From 9a11e00a2a5acdcd1e693b5b7765be551d977bd2 Mon Sep 17 00:00:00 2001 From: Ivan Shalganov Date: Thu, 13 Dec 2012 18:48:40 +0400 Subject: [PATCH 3/6] Add: Generator::raise() Add: Generator::raise() tests --- Zend/tests/generators/raise_deep.phpt | 35 ++++++ ...se_exception.phpt => raise_exception.phpt} | 14 ++- .../raise_unexpected_exception.phpt | 32 ++++++ Zend/zend_generators.c | 33 +++--- Zend/zend_vm_def.h | 9 +- Zend/zend_vm_execute.h | 100 +++++++++++++----- 6 files changed, 170 insertions(+), 53 deletions(-) create mode 100644 Zend/tests/generators/raise_deep.phpt rename Zend/tests/generators/{rise_exception.phpt => raise_exception.phpt} (63%) create mode 100644 Zend/tests/generators/raise_unexpected_exception.phpt diff --git a/Zend/tests/generators/raise_deep.phpt b/Zend/tests/generators/raise_deep.phpt new file mode 100644 index 000000000000..131e49961744 --- /dev/null +++ b/Zend/tests/generators/raise_deep.phpt @@ -0,0 +1,35 @@ +--TEST-- +Raise exception in the generator +--FILE-- +getMessage()); + throw $e; + } + var_dump(yield "yield bar"); +} + +function gen2() { + var_dump("start sub generator"); + + var_dump(yield "yield foo"); +} + +$gen = gen(); +var_dump($gen->current()); +$gen->raise(new Exception("raise exception")); +var_dump($gen->current()); +$gen->send("send foo"); + +?> +--EXPECT-- +string(15) "start generator" +string(9) "yield foo" +string(14) "raise exception" +string(14) "exception dtor" +string(9) "yield bar" +string(8) "send foo" diff --git a/Zend/tests/generators/rise_exception.phpt b/Zend/tests/generators/raise_exception.phpt similarity index 63% rename from Zend/tests/generators/rise_exception.phpt rename to Zend/tests/generators/raise_exception.phpt index 02945690d085..420d75505a4d 100644 --- a/Zend/tests/generators/rise_exception.phpt +++ b/Zend/tests/generators/raise_exception.phpt @@ -1,8 +1,12 @@ --TEST-- -Rise exception in the generator +Raise exception in the generator --FILE-- getMessage()); + unset($e); } var_dump(yield "yield bar"); } $gen = gen(); var_dump($gen->current()); -$gen->rise(new Exception("rise exception")); +$gen->raise(new ExceptionEx("raise exception")); var_dump($gen->current()); $gen->send("send foo"); @@ -24,6 +29,7 @@ $gen->send("send foo"); --EXPECT-- string(15) "start generator" string(9) "yield foo" -string(14) "rise exception" +string(15) "raise exception" +string(14) "exception dtor" string(9) "yield bar" string(8) "send foo" diff --git a/Zend/tests/generators/raise_unexpected_exception.phpt b/Zend/tests/generators/raise_unexpected_exception.phpt new file mode 100644 index 000000000000..7a1316c2a1ab --- /dev/null +++ b/Zend/tests/generators/raise_unexpected_exception.phpt @@ -0,0 +1,32 @@ +--TEST-- +Raise exception in the generator +--FILE-- +current()); +$gen->raise(new Exception("raise exception")); +var_dump($gen->current()); +$gen->send("send foo"); + +?> +--EXPECT-- +string(15) "start generator" +string(9) "yield foo" +string(14) "raise exception" +string(14) "exception dtor" +string(9) "yield bar" +string(8) "send foo" diff --git a/Zend/zend_generators.c b/Zend/zend_generators.c index b653d916def7..76e9009574fe 100644 --- a/Zend/zend_generators.c +++ b/Zend/zend_generators.c @@ -454,6 +454,7 @@ void zend_generator_resume(zend_generator *generator TSRMLS_DC) /* {{{ */ if(generator->exception) { EG(exception) = generator->exception; generator->exception = NULL; + zend_throw_exception_internal(NULL TSRMLS_CC); } /* Resume execution */ @@ -628,9 +629,9 @@ ZEND_METHOD(Generator, send) } /* }}} */ -/* {{{ proto mixed Generator::rise() - * Throws exceptions into the generator */ -ZEND_METHOD(Generator, rise) +/* {{{ proto mixed Generator::raise() + * Throw exception into the generator */ +ZEND_METHOD(Generator, raise) { zval *exc; zend_generator *generator; @@ -639,23 +640,23 @@ ZEND_METHOD(Generator, rise) } generator = (zend_generator *) zend_object_store_get_object(getThis() TSRMLS_CC); - + + if(generator->exception) { + zval_ptr_dtor(&(generator->exception)); + } + + ALLOC_INIT_ZVAL(generator->exception); + ZVAL_ZVAL(generator->exception, exc, 1, 0); + //generator->exception = exc; zend_generator_ensure_initialized(generator TSRMLS_CC); /* The generator is already closed, thus can't send anything */ if (!generator->execute_data) { return; } - - /* The sent value was initialized to NULL, so dtor that */ - /*zval_ptr_dtor(&generator->send_target->var.ptr); - - Z_ADDREF_P(exc); - generator->send_target->var.ptr = exc; - generator->send_target->var.ptr_ptr = &exc; - generator->flags |= ZEND_GENERATOR_RISE_EXCEPTION;*/ - Z_ADDREF_P(exc); - generator->exception = exc; + + /* The sent value was initialized to NULL, so dtor that */ + zval_ptr_dtor(&generator->send_target->var.ptr); zend_generator_resume(generator TSRMLS_CC); @@ -806,7 +807,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_generator_send, 0, 0, 1) ZEND_ARG_INFO(0, value) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_generator_rise, 0, 0, 1) +ZEND_BEGIN_ARG_INFO_EX(arginfo_generator_raise, 0, 0, 1) ZEND_ARG_INFO(0, exception) ZEND_END_ARG_INFO() @@ -817,7 +818,7 @@ static const zend_function_entry generator_functions[] = { ZEND_ME(Generator, key, arginfo_generator_void, ZEND_ACC_PUBLIC) ZEND_ME(Generator, next, arginfo_generator_void, ZEND_ACC_PUBLIC) ZEND_ME(Generator, send, arginfo_generator_send, ZEND_ACC_PUBLIC) - ZEND_ME(Generator, rise, arginfo_generator_rise, ZEND_ACC_PUBLIC) + ZEND_ME(Generator, raise, arginfo_generator_raise, ZEND_ACC_PUBLIC) ZEND_ME(Generator, __wakeup, arginfo_generator_void, ZEND_ACC_PUBLIC) ZEND_FE_END }; diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h index 1895972faee7..15de0e89b59e 100644 --- a/Zend/zend_vm_def.h +++ b/Zend/zend_vm_def.h @@ -5395,12 +5395,6 @@ ZEND_VM_HANDLER(160, ZEND_YIELD, CONST|TMP|VAR|CV|UNUSED, CONST|TMP|VAR|CV|UNUSE ZVAL_LONG(generator->key, generator->largest_used_integer_key); } - - if (UNEXPECTED(EG(exception) != NULL)) { - //zval_ptr_dtor(&EX_T(opline->result.var).var.ptr); - HANDLE_EXCEPTION(); - ZEND_VM_RETURN(); - } /* If a value is sent it should go into the result var */ generator->send_target = &EX_T(opline->result.var); @@ -5409,12 +5403,11 @@ ZEND_VM_HANDLER(160, ZEND_YIELD, CONST|TMP|VAR|CV|UNUSED, CONST|TMP|VAR|CV|UNUSE Z_ADDREF(EG(uninitialized_zval)); AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); - CHECK_EXCEPTION(); + //CHECK_EXCEPTION(); /* We increment to the next op, so we are at the correct position when the * generator is resumed. */ ZEND_VM_INC_OPCODE(); - //ZEND_VM_CONTINUE(); /* The GOTO VM uses a local opline variable. We need to set the opline * variable in execute_data so we don't resume at an old position. */ diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h index 80967bdfb3c8..3b0d6f71f50b 100644 --- a/Zend/zend_vm_execute.h +++ b/Zend/zend_vm_execute.h @@ -4188,10 +4188,13 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLE /* If a value is sent it should go into the result var */ generator->send_target = &EX_T(opline->result.var); + /* Initialize the sent value to NULL */ Z_ADDREF(EG(uninitialized_zval)); AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); + //CHECK_EXCEPTION(); + /* We increment to the next op, so we are at the correct position when the * generator is resumed. */ ZEND_VM_INC_OPCODE(); @@ -4199,7 +4202,6 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLE /* The GOTO VM uses a local opline variable. We need to set the opline * variable in execute_data so we don't resume at an old position. */ SAVE_OPLINE(); - ZEND_VM_RETURN(); } @@ -4884,10 +4886,13 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ /* If a value is sent it should go into the result var */ generator->send_target = &EX_T(opline->result.var); + /* Initialize the sent value to NULL */ Z_ADDREF(EG(uninitialized_zval)); AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); + //CHECK_EXCEPTION(); + /* We increment to the next op, so we are at the correct position when the * generator is resumed. */ ZEND_VM_INC_OPCODE(); @@ -4895,7 +4900,6 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ /* The GOTO VM uses a local opline variable. We need to set the opline * variable in execute_data so we don't resume at an old position. */ SAVE_OPLINE(); - ZEND_VM_RETURN(); } @@ -5906,10 +5910,13 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ /* If a value is sent it should go into the result var */ generator->send_target = &EX_T(opline->result.var); + /* Initialize the sent value to NULL */ Z_ADDREF(EG(uninitialized_zval)); AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); + //CHECK_EXCEPTION(); + /* We increment to the next op, so we are at the correct position when the * generator is resumed. */ ZEND_VM_INC_OPCODE(); @@ -5917,7 +5924,6 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ /* The GOTO VM uses a local opline variable. We need to set the opline * variable in execute_data so we don't resume at an old position. */ SAVE_OPLINE(); - ZEND_VM_RETURN(); } @@ -6621,10 +6627,13 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_UNUSED_HANDLER(ZEND_OPCODE_HANDL /* If a value is sent it should go into the result var */ generator->send_target = &EX_T(opline->result.var); + /* Initialize the sent value to NULL */ Z_ADDREF(EG(uninitialized_zval)); AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); + //CHECK_EXCEPTION(); + /* We increment to the next op, so we are at the correct position when the * generator is resumed. */ ZEND_VM_INC_OPCODE(); @@ -6632,7 +6641,6 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_UNUSED_HANDLER(ZEND_OPCODE_HANDL /* The GOTO VM uses a local opline variable. We need to set the opline * variable in execute_data so we don't resume at an old position. */ SAVE_OPLINE(); - ZEND_VM_RETURN(); } @@ -7376,10 +7384,13 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_A /* If a value is sent it should go into the result var */ generator->send_target = &EX_T(opline->result.var); + /* Initialize the sent value to NULL */ Z_ADDREF(EG(uninitialized_zval)); AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); + //CHECK_EXCEPTION(); + /* We increment to the next op, so we are at the correct position when the * generator is resumed. */ ZEND_VM_INC_OPCODE(); @@ -7387,7 +7398,6 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_A /* The GOTO VM uses a local opline variable. We need to set the opline * variable in execute_data so we don't resume at an old position. */ SAVE_OPLINE(); - ZEND_VM_RETURN(); } @@ -9431,10 +9441,13 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ /* If a value is sent it should go into the result var */ generator->send_target = &EX_T(opline->result.var); + /* Initialize the sent value to NULL */ Z_ADDREF(EG(uninitialized_zval)); AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); + //CHECK_EXCEPTION(); + /* We increment to the next op, so we are at the correct position when the * generator is resumed. */ ZEND_VM_INC_OPCODE(); @@ -9442,7 +9455,6 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ /* The GOTO VM uses a local opline variable. We need to set the opline * variable in execute_data so we don't resume at an old position. */ SAVE_OPLINE(); - ZEND_VM_RETURN(); } @@ -10127,10 +10139,13 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_AR /* If a value is sent it should go into the result var */ generator->send_target = &EX_T(opline->result.var); + /* Initialize the sent value to NULL */ Z_ADDREF(EG(uninitialized_zval)); AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); + //CHECK_EXCEPTION(); + /* We increment to the next op, so we are at the correct position when the * generator is resumed. */ ZEND_VM_INC_OPCODE(); @@ -10138,7 +10153,6 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_AR /* The GOTO VM uses a local opline variable. We need to set the opline * variable in execute_data so we don't resume at an old position. */ SAVE_OPLINE(); - ZEND_VM_RETURN(); } @@ -11149,10 +11163,13 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR /* If a value is sent it should go into the result var */ generator->send_target = &EX_T(opline->result.var); + /* Initialize the sent value to NULL */ Z_ADDREF(EG(uninitialized_zval)); AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); + //CHECK_EXCEPTION(); + /* We increment to the next op, so we are at the correct position when the * generator is resumed. */ ZEND_VM_INC_OPCODE(); @@ -11160,7 +11177,6 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR /* The GOTO VM uses a local opline variable. We need to set the opline * variable in execute_data so we don't resume at an old position. */ SAVE_OPLINE(); - ZEND_VM_RETURN(); } @@ -11728,10 +11744,13 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_UNUSED_HANDLER(ZEND_OPCODE_HANDLER /* If a value is sent it should go into the result var */ generator->send_target = &EX_T(opline->result.var); + /* Initialize the sent value to NULL */ Z_ADDREF(EG(uninitialized_zval)); AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); + //CHECK_EXCEPTION(); + /* We increment to the next op, so we are at the correct position when the * generator is resumed. */ ZEND_VM_INC_OPCODE(); @@ -11739,7 +11758,6 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_UNUSED_HANDLER(ZEND_OPCODE_HANDLER /* The GOTO VM uses a local opline variable. We need to set the opline * variable in execute_data so we don't resume at an old position. */ SAVE_OPLINE(); - ZEND_VM_RETURN(); } @@ -12421,10 +12439,13 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARG /* If a value is sent it should go into the result var */ generator->send_target = &EX_T(opline->result.var); + /* Initialize the sent value to NULL */ Z_ADDREF(EG(uninitialized_zval)); AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); + //CHECK_EXCEPTION(); + /* We increment to the next op, so we are at the correct position when the * generator is resumed. */ ZEND_VM_INC_OPCODE(); @@ -12432,7 +12453,6 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARG /* The GOTO VM uses a local opline variable. We need to set the opline * variable in execute_data so we don't resume at an old position. */ SAVE_OPLINE(); - ZEND_VM_RETURN(); } @@ -16337,10 +16357,13 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ /* If a value is sent it should go into the result var */ generator->send_target = &EX_T(opline->result.var); + /* Initialize the sent value to NULL */ Z_ADDREF(EG(uninitialized_zval)); AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); + //CHECK_EXCEPTION(); + /* We increment to the next op, so we are at the correct position when the * generator is resumed. */ ZEND_VM_INC_OPCODE(); @@ -16348,7 +16371,6 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ /* The GOTO VM uses a local opline variable. We need to set the opline * variable in execute_data so we don't resume at an old position. */ SAVE_OPLINE(); - ZEND_VM_RETURN(); } @@ -18424,10 +18446,13 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_AR /* If a value is sent it should go into the result var */ generator->send_target = &EX_T(opline->result.var); + /* Initialize the sent value to NULL */ Z_ADDREF(EG(uninitialized_zval)); AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); + //CHECK_EXCEPTION(); + /* We increment to the next op, so we are at the correct position when the * generator is resumed. */ ZEND_VM_INC_OPCODE(); @@ -18435,7 +18460,6 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_AR /* The GOTO VM uses a local opline variable. We need to set the opline * variable in execute_data so we don't resume at an old position. */ SAVE_OPLINE(); - ZEND_VM_RETURN(); } @@ -20892,10 +20916,13 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR /* If a value is sent it should go into the result var */ generator->send_target = &EX_T(opline->result.var); + /* Initialize the sent value to NULL */ Z_ADDREF(EG(uninitialized_zval)); AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); + //CHECK_EXCEPTION(); + /* We increment to the next op, so we are at the correct position when the * generator is resumed. */ ZEND_VM_INC_OPCODE(); @@ -20903,7 +20930,6 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR /* The GOTO VM uses a local opline variable. We need to set the opline * variable in execute_data so we don't resume at an old position. */ SAVE_OPLINE(); - ZEND_VM_RETURN(); } @@ -22034,10 +22060,13 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER /* If a value is sent it should go into the result var */ generator->send_target = &EX_T(opline->result.var); + /* Initialize the sent value to NULL */ Z_ADDREF(EG(uninitialized_zval)); AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); + //CHECK_EXCEPTION(); + /* We increment to the next op, so we are at the correct position when the * generator is resumed. */ ZEND_VM_INC_OPCODE(); @@ -22045,7 +22074,6 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER /* The GOTO VM uses a local opline variable. We need to set the opline * variable in execute_data so we don't resume at an old position. */ SAVE_OPLINE(); - ZEND_VM_RETURN(); } @@ -24170,10 +24198,13 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARG /* If a value is sent it should go into the result var */ generator->send_target = &EX_T(opline->result.var); + /* Initialize the sent value to NULL */ Z_ADDREF(EG(uninitialized_zval)); AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); + //CHECK_EXCEPTION(); + /* We increment to the next op, so we are at the correct position when the * generator is resumed. */ ZEND_VM_INC_OPCODE(); @@ -24181,7 +24212,6 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARG /* The GOTO VM uses a local opline variable. We need to set the opline * variable in execute_data so we don't resume at an old position. */ SAVE_OPLINE(); - ZEND_VM_RETURN(); } @@ -25661,10 +25691,13 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDL /* If a value is sent it should go into the result var */ generator->send_target = &EX_T(opline->result.var); + /* Initialize the sent value to NULL */ Z_ADDREF(EG(uninitialized_zval)); AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); + //CHECK_EXCEPTION(); + /* We increment to the next op, so we are at the correct position when the * generator is resumed. */ ZEND_VM_INC_OPCODE(); @@ -25672,7 +25705,6 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDL /* The GOTO VM uses a local opline variable. We need to set the opline * variable in execute_data so we don't resume at an old position. */ SAVE_OPLINE(); - ZEND_VM_RETURN(); } @@ -26976,10 +27008,13 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER /* If a value is sent it should go into the result var */ generator->send_target = &EX_T(opline->result.var); + /* Initialize the sent value to NULL */ Z_ADDREF(EG(uninitialized_zval)); AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); + //CHECK_EXCEPTION(); + /* We increment to the next op, so we are at the correct position when the * generator is resumed. */ ZEND_VM_INC_OPCODE(); @@ -26987,7 +27022,6 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER /* The GOTO VM uses a local opline variable. We need to set the opline * variable in execute_data so we don't resume at an old position. */ SAVE_OPLINE(); - ZEND_VM_RETURN(); } @@ -28292,10 +28326,13 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER /* If a value is sent it should go into the result var */ generator->send_target = &EX_T(opline->result.var); + /* Initialize the sent value to NULL */ Z_ADDREF(EG(uninitialized_zval)); AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); + //CHECK_EXCEPTION(); + /* We increment to the next op, so we are at the correct position when the * generator is resumed. */ ZEND_VM_INC_OPCODE(); @@ -28303,7 +28340,6 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER /* The GOTO VM uses a local opline variable. We need to set the opline * variable in execute_data so we don't resume at an old position. */ SAVE_OPLINE(); - ZEND_VM_RETURN(); } @@ -28715,10 +28751,13 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_UNUSED_UNUSED_HANDLER(ZEND_OPCODE_HAND /* If a value is sent it should go into the result var */ generator->send_target = &EX_T(opline->result.var); + /* Initialize the sent value to NULL */ Z_ADDREF(EG(uninitialized_zval)); AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); + //CHECK_EXCEPTION(); + /* We increment to the next op, so we are at the correct position when the * generator is resumed. */ ZEND_VM_INC_OPCODE(); @@ -28726,7 +28765,6 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_UNUSED_UNUSED_HANDLER(ZEND_OPCODE_HAND /* The GOTO VM uses a local opline variable. We need to set the opline * variable in execute_data so we don't resume at an old position. */ SAVE_OPLINE(); - ZEND_VM_RETURN(); } @@ -30027,10 +30065,13 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ /* If a value is sent it should go into the result var */ generator->send_target = &EX_T(opline->result.var); + /* Initialize the sent value to NULL */ Z_ADDREF(EG(uninitialized_zval)); AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); + //CHECK_EXCEPTION(); + /* We increment to the next op, so we are at the correct position when the * generator is resumed. */ ZEND_VM_INC_OPCODE(); @@ -30038,7 +30079,6 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ /* The GOTO VM uses a local opline variable. We need to set the opline * variable in execute_data so we don't resume at an old position. */ SAVE_OPLINE(); - ZEND_VM_RETURN(); } @@ -33540,10 +33580,13 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_A /* If a value is sent it should go into the result var */ generator->send_target = &EX_T(opline->result.var); + /* Initialize the sent value to NULL */ Z_ADDREF(EG(uninitialized_zval)); AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); + //CHECK_EXCEPTION(); + /* We increment to the next op, so we are at the correct position when the * generator is resumed. */ ZEND_VM_INC_OPCODE(); @@ -33551,7 +33594,6 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_A /* The GOTO VM uses a local opline variable. We need to set the opline * variable in execute_data so we don't resume at an old position. */ SAVE_OPLINE(); - ZEND_VM_RETURN(); } @@ -35494,10 +35536,13 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARG /* If a value is sent it should go into the result var */ generator->send_target = &EX_T(opline->result.var); + /* Initialize the sent value to NULL */ Z_ADDREF(EG(uninitialized_zval)); AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); + //CHECK_EXCEPTION(); + /* We increment to the next op, so we are at the correct position when the * generator is resumed. */ ZEND_VM_INC_OPCODE(); @@ -35505,7 +35550,6 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARG /* The GOTO VM uses a local opline variable. We need to set the opline * variable in execute_data so we don't resume at an old position. */ SAVE_OPLINE(); - ZEND_VM_RETURN(); } @@ -37828,10 +37872,13 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG /* If a value is sent it should go into the result var */ generator->send_target = &EX_T(opline->result.var); + /* Initialize the sent value to NULL */ Z_ADDREF(EG(uninitialized_zval)); AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); + //CHECK_EXCEPTION(); + /* We increment to the next op, so we are at the correct position when the * generator is resumed. */ ZEND_VM_INC_OPCODE(); @@ -37839,7 +37886,6 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG /* The GOTO VM uses a local opline variable. We need to set the opline * variable in execute_data so we don't resume at an old position. */ SAVE_OPLINE(); - ZEND_VM_RETURN(); } @@ -38827,10 +38873,13 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ /* If a value is sent it should go into the result var */ generator->send_target = &EX_T(opline->result.var); + /* Initialize the sent value to NULL */ Z_ADDREF(EG(uninitialized_zval)); AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); + //CHECK_EXCEPTION(); + /* We increment to the next op, so we are at the correct position when the * generator is resumed. */ ZEND_VM_INC_OPCODE(); @@ -38838,7 +38887,6 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ /* The GOTO VM uses a local opline variable. We need to set the opline * variable in execute_data so we don't resume at an old position. */ SAVE_OPLINE(); - ZEND_VM_RETURN(); } @@ -40829,10 +40877,13 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS /* If a value is sent it should go into the result var */ generator->send_target = &EX_T(opline->result.var); + /* Initialize the sent value to NULL */ Z_ADDREF(EG(uninitialized_zval)); AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); + //CHECK_EXCEPTION(); + /* We increment to the next op, so we are at the correct position when the * generator is resumed. */ ZEND_VM_INC_OPCODE(); @@ -40840,7 +40891,6 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS /* The GOTO VM uses a local opline variable. We need to set the opline * variable in execute_data so we don't resume at an old position. */ SAVE_OPLINE(); - ZEND_VM_RETURN(); } From 82351a6b6789ad73fbbe4c0358a8d1dc3d51275d Mon Sep 17 00:00:00 2001 From: Ivan Shalganov Date: Tue, 18 Dec 2012 11:32:59 +0400 Subject: [PATCH 4/6] Revert: zend.vm.def.h --- Zend/zend_vm_def.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h index 15de0e89b59e..06a2cdbfeb05 100644 --- a/Zend/zend_vm_def.h +++ b/Zend/zend_vm_def.h @@ -5398,13 +5398,10 @@ ZEND_VM_HANDLER(160, ZEND_YIELD, CONST|TMP|VAR|CV|UNUSED, CONST|TMP|VAR|CV|UNUSE /* If a value is sent it should go into the result var */ generator->send_target = &EX_T(opline->result.var); - /* Initialize the sent value to NULL */ Z_ADDREF(EG(uninitialized_zval)); AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); - //CHECK_EXCEPTION(); - /* We increment to the next op, so we are at the correct position when the * generator is resumed. */ ZEND_VM_INC_OPCODE(); @@ -5412,6 +5409,7 @@ ZEND_VM_HANDLER(160, ZEND_YIELD, CONST|TMP|VAR|CV|UNUSED, CONST|TMP|VAR|CV|UNUSE /* The GOTO VM uses a local opline variable. We need to set the opline * variable in execute_data so we don't resume at an old position. */ SAVE_OPLINE(); + ZEND_VM_RETURN(); } From be5f057d8e9ae32ba6b549bf819744594534418d Mon Sep 17 00:00:00 2001 From: Ivan Shalganov Date: Tue, 18 Dec 2012 11:34:11 +0400 Subject: [PATCH 5/6] Revert: zend.vm.def.h --- Zend/zend_vm_def.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h index 06a2cdbfeb05..edbffe12c990 100644 --- a/Zend/zend_vm_def.h +++ b/Zend/zend_vm_def.h @@ -5397,7 +5397,7 @@ ZEND_VM_HANDLER(160, ZEND_YIELD, CONST|TMP|VAR|CV|UNUSED, CONST|TMP|VAR|CV|UNUSE /* If a value is sent it should go into the result var */ generator->send_target = &EX_T(opline->result.var); - + /* Initialize the sent value to NULL */ Z_ADDREF(EG(uninitialized_zval)); AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); @@ -5409,7 +5409,7 @@ ZEND_VM_HANDLER(160, ZEND_YIELD, CONST|TMP|VAR|CV|UNUSED, CONST|TMP|VAR|CV|UNUSE /* The GOTO VM uses a local opline variable. We need to set the opline * variable in execute_data so we don't resume at an old position. */ SAVE_OPLINE(); - + ZEND_VM_RETURN(); } From 74a5722b3586dd8d8b736958d834f7a27e2ad84b Mon Sep 17 00:00:00 2001 From: Ivan Shalganov Date: Tue, 18 Dec 2012 11:35:08 +0400 Subject: [PATCH 6/6] Revert: zend.vm.def.h --- Zend/zend_vm_execute.h | 100 +++++++++++------------------------------ 1 file changed, 25 insertions(+), 75 deletions(-) diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h index 3b0d6f71f50b..80967bdfb3c8 100644 --- a/Zend/zend_vm_execute.h +++ b/Zend/zend_vm_execute.h @@ -4188,13 +4188,10 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLE /* If a value is sent it should go into the result var */ generator->send_target = &EX_T(opline->result.var); - /* Initialize the sent value to NULL */ Z_ADDREF(EG(uninitialized_zval)); AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); - //CHECK_EXCEPTION(); - /* We increment to the next op, so we are at the correct position when the * generator is resumed. */ ZEND_VM_INC_OPCODE(); @@ -4202,6 +4199,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLE /* The GOTO VM uses a local opline variable. We need to set the opline * variable in execute_data so we don't resume at an old position. */ SAVE_OPLINE(); + ZEND_VM_RETURN(); } @@ -4886,13 +4884,10 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ /* If a value is sent it should go into the result var */ generator->send_target = &EX_T(opline->result.var); - /* Initialize the sent value to NULL */ Z_ADDREF(EG(uninitialized_zval)); AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); - //CHECK_EXCEPTION(); - /* We increment to the next op, so we are at the correct position when the * generator is resumed. */ ZEND_VM_INC_OPCODE(); @@ -4900,6 +4895,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ /* The GOTO VM uses a local opline variable. We need to set the opline * variable in execute_data so we don't resume at an old position. */ SAVE_OPLINE(); + ZEND_VM_RETURN(); } @@ -5910,13 +5906,10 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ /* If a value is sent it should go into the result var */ generator->send_target = &EX_T(opline->result.var); - /* Initialize the sent value to NULL */ Z_ADDREF(EG(uninitialized_zval)); AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); - //CHECK_EXCEPTION(); - /* We increment to the next op, so we are at the correct position when the * generator is resumed. */ ZEND_VM_INC_OPCODE(); @@ -5924,6 +5917,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ /* The GOTO VM uses a local opline variable. We need to set the opline * variable in execute_data so we don't resume at an old position. */ SAVE_OPLINE(); + ZEND_VM_RETURN(); } @@ -6627,13 +6621,10 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_UNUSED_HANDLER(ZEND_OPCODE_HANDL /* If a value is sent it should go into the result var */ generator->send_target = &EX_T(opline->result.var); - /* Initialize the sent value to NULL */ Z_ADDREF(EG(uninitialized_zval)); AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); - //CHECK_EXCEPTION(); - /* We increment to the next op, so we are at the correct position when the * generator is resumed. */ ZEND_VM_INC_OPCODE(); @@ -6641,6 +6632,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_UNUSED_HANDLER(ZEND_OPCODE_HANDL /* The GOTO VM uses a local opline variable. We need to set the opline * variable in execute_data so we don't resume at an old position. */ SAVE_OPLINE(); + ZEND_VM_RETURN(); } @@ -7384,13 +7376,10 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_A /* If a value is sent it should go into the result var */ generator->send_target = &EX_T(opline->result.var); - /* Initialize the sent value to NULL */ Z_ADDREF(EG(uninitialized_zval)); AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); - //CHECK_EXCEPTION(); - /* We increment to the next op, so we are at the correct position when the * generator is resumed. */ ZEND_VM_INC_OPCODE(); @@ -7398,6 +7387,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_A /* The GOTO VM uses a local opline variable. We need to set the opline * variable in execute_data so we don't resume at an old position. */ SAVE_OPLINE(); + ZEND_VM_RETURN(); } @@ -9441,13 +9431,10 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ /* If a value is sent it should go into the result var */ generator->send_target = &EX_T(opline->result.var); - /* Initialize the sent value to NULL */ Z_ADDREF(EG(uninitialized_zval)); AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); - //CHECK_EXCEPTION(); - /* We increment to the next op, so we are at the correct position when the * generator is resumed. */ ZEND_VM_INC_OPCODE(); @@ -9455,6 +9442,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ /* The GOTO VM uses a local opline variable. We need to set the opline * variable in execute_data so we don't resume at an old position. */ SAVE_OPLINE(); + ZEND_VM_RETURN(); } @@ -10139,13 +10127,10 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_AR /* If a value is sent it should go into the result var */ generator->send_target = &EX_T(opline->result.var); - /* Initialize the sent value to NULL */ Z_ADDREF(EG(uninitialized_zval)); AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); - //CHECK_EXCEPTION(); - /* We increment to the next op, so we are at the correct position when the * generator is resumed. */ ZEND_VM_INC_OPCODE(); @@ -10153,6 +10138,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_AR /* The GOTO VM uses a local opline variable. We need to set the opline * variable in execute_data so we don't resume at an old position. */ SAVE_OPLINE(); + ZEND_VM_RETURN(); } @@ -11163,13 +11149,10 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR /* If a value is sent it should go into the result var */ generator->send_target = &EX_T(opline->result.var); - /* Initialize the sent value to NULL */ Z_ADDREF(EG(uninitialized_zval)); AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); - //CHECK_EXCEPTION(); - /* We increment to the next op, so we are at the correct position when the * generator is resumed. */ ZEND_VM_INC_OPCODE(); @@ -11177,6 +11160,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR /* The GOTO VM uses a local opline variable. We need to set the opline * variable in execute_data so we don't resume at an old position. */ SAVE_OPLINE(); + ZEND_VM_RETURN(); } @@ -11744,13 +11728,10 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_UNUSED_HANDLER(ZEND_OPCODE_HANDLER /* If a value is sent it should go into the result var */ generator->send_target = &EX_T(opline->result.var); - /* Initialize the sent value to NULL */ Z_ADDREF(EG(uninitialized_zval)); AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); - //CHECK_EXCEPTION(); - /* We increment to the next op, so we are at the correct position when the * generator is resumed. */ ZEND_VM_INC_OPCODE(); @@ -11758,6 +11739,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_UNUSED_HANDLER(ZEND_OPCODE_HANDLER /* The GOTO VM uses a local opline variable. We need to set the opline * variable in execute_data so we don't resume at an old position. */ SAVE_OPLINE(); + ZEND_VM_RETURN(); } @@ -12439,13 +12421,10 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARG /* If a value is sent it should go into the result var */ generator->send_target = &EX_T(opline->result.var); - /* Initialize the sent value to NULL */ Z_ADDREF(EG(uninitialized_zval)); AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); - //CHECK_EXCEPTION(); - /* We increment to the next op, so we are at the correct position when the * generator is resumed. */ ZEND_VM_INC_OPCODE(); @@ -12453,6 +12432,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARG /* The GOTO VM uses a local opline variable. We need to set the opline * variable in execute_data so we don't resume at an old position. */ SAVE_OPLINE(); + ZEND_VM_RETURN(); } @@ -16357,13 +16337,10 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ /* If a value is sent it should go into the result var */ generator->send_target = &EX_T(opline->result.var); - /* Initialize the sent value to NULL */ Z_ADDREF(EG(uninitialized_zval)); AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); - //CHECK_EXCEPTION(); - /* We increment to the next op, so we are at the correct position when the * generator is resumed. */ ZEND_VM_INC_OPCODE(); @@ -16371,6 +16348,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ /* The GOTO VM uses a local opline variable. We need to set the opline * variable in execute_data so we don't resume at an old position. */ SAVE_OPLINE(); + ZEND_VM_RETURN(); } @@ -18446,13 +18424,10 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_AR /* If a value is sent it should go into the result var */ generator->send_target = &EX_T(opline->result.var); - /* Initialize the sent value to NULL */ Z_ADDREF(EG(uninitialized_zval)); AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); - //CHECK_EXCEPTION(); - /* We increment to the next op, so we are at the correct position when the * generator is resumed. */ ZEND_VM_INC_OPCODE(); @@ -18460,6 +18435,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_AR /* The GOTO VM uses a local opline variable. We need to set the opline * variable in execute_data so we don't resume at an old position. */ SAVE_OPLINE(); + ZEND_VM_RETURN(); } @@ -20916,13 +20892,10 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR /* If a value is sent it should go into the result var */ generator->send_target = &EX_T(opline->result.var); - /* Initialize the sent value to NULL */ Z_ADDREF(EG(uninitialized_zval)); AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); - //CHECK_EXCEPTION(); - /* We increment to the next op, so we are at the correct position when the * generator is resumed. */ ZEND_VM_INC_OPCODE(); @@ -20930,6 +20903,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR /* The GOTO VM uses a local opline variable. We need to set the opline * variable in execute_data so we don't resume at an old position. */ SAVE_OPLINE(); + ZEND_VM_RETURN(); } @@ -22060,13 +22034,10 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER /* If a value is sent it should go into the result var */ generator->send_target = &EX_T(opline->result.var); - /* Initialize the sent value to NULL */ Z_ADDREF(EG(uninitialized_zval)); AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); - //CHECK_EXCEPTION(); - /* We increment to the next op, so we are at the correct position when the * generator is resumed. */ ZEND_VM_INC_OPCODE(); @@ -22074,6 +22045,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER /* The GOTO VM uses a local opline variable. We need to set the opline * variable in execute_data so we don't resume at an old position. */ SAVE_OPLINE(); + ZEND_VM_RETURN(); } @@ -24198,13 +24170,10 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARG /* If a value is sent it should go into the result var */ generator->send_target = &EX_T(opline->result.var); - /* Initialize the sent value to NULL */ Z_ADDREF(EG(uninitialized_zval)); AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); - //CHECK_EXCEPTION(); - /* We increment to the next op, so we are at the correct position when the * generator is resumed. */ ZEND_VM_INC_OPCODE(); @@ -24212,6 +24181,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARG /* The GOTO VM uses a local opline variable. We need to set the opline * variable in execute_data so we don't resume at an old position. */ SAVE_OPLINE(); + ZEND_VM_RETURN(); } @@ -25691,13 +25661,10 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDL /* If a value is sent it should go into the result var */ generator->send_target = &EX_T(opline->result.var); - /* Initialize the sent value to NULL */ Z_ADDREF(EG(uninitialized_zval)); AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); - //CHECK_EXCEPTION(); - /* We increment to the next op, so we are at the correct position when the * generator is resumed. */ ZEND_VM_INC_OPCODE(); @@ -25705,6 +25672,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDL /* The GOTO VM uses a local opline variable. We need to set the opline * variable in execute_data so we don't resume at an old position. */ SAVE_OPLINE(); + ZEND_VM_RETURN(); } @@ -27008,13 +26976,10 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER /* If a value is sent it should go into the result var */ generator->send_target = &EX_T(opline->result.var); - /* Initialize the sent value to NULL */ Z_ADDREF(EG(uninitialized_zval)); AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); - //CHECK_EXCEPTION(); - /* We increment to the next op, so we are at the correct position when the * generator is resumed. */ ZEND_VM_INC_OPCODE(); @@ -27022,6 +26987,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER /* The GOTO VM uses a local opline variable. We need to set the opline * variable in execute_data so we don't resume at an old position. */ SAVE_OPLINE(); + ZEND_VM_RETURN(); } @@ -28326,13 +28292,10 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER /* If a value is sent it should go into the result var */ generator->send_target = &EX_T(opline->result.var); - /* Initialize the sent value to NULL */ Z_ADDREF(EG(uninitialized_zval)); AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); - //CHECK_EXCEPTION(); - /* We increment to the next op, so we are at the correct position when the * generator is resumed. */ ZEND_VM_INC_OPCODE(); @@ -28340,6 +28303,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER /* The GOTO VM uses a local opline variable. We need to set the opline * variable in execute_data so we don't resume at an old position. */ SAVE_OPLINE(); + ZEND_VM_RETURN(); } @@ -28751,13 +28715,10 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_UNUSED_UNUSED_HANDLER(ZEND_OPCODE_HAND /* If a value is sent it should go into the result var */ generator->send_target = &EX_T(opline->result.var); - /* Initialize the sent value to NULL */ Z_ADDREF(EG(uninitialized_zval)); AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); - //CHECK_EXCEPTION(); - /* We increment to the next op, so we are at the correct position when the * generator is resumed. */ ZEND_VM_INC_OPCODE(); @@ -28765,6 +28726,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_UNUSED_UNUSED_HANDLER(ZEND_OPCODE_HAND /* The GOTO VM uses a local opline variable. We need to set the opline * variable in execute_data so we don't resume at an old position. */ SAVE_OPLINE(); + ZEND_VM_RETURN(); } @@ -30065,13 +30027,10 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ /* If a value is sent it should go into the result var */ generator->send_target = &EX_T(opline->result.var); - /* Initialize the sent value to NULL */ Z_ADDREF(EG(uninitialized_zval)); AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); - //CHECK_EXCEPTION(); - /* We increment to the next op, so we are at the correct position when the * generator is resumed. */ ZEND_VM_INC_OPCODE(); @@ -30079,6 +30038,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ /* The GOTO VM uses a local opline variable. We need to set the opline * variable in execute_data so we don't resume at an old position. */ SAVE_OPLINE(); + ZEND_VM_RETURN(); } @@ -33580,13 +33540,10 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_A /* If a value is sent it should go into the result var */ generator->send_target = &EX_T(opline->result.var); - /* Initialize the sent value to NULL */ Z_ADDREF(EG(uninitialized_zval)); AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); - //CHECK_EXCEPTION(); - /* We increment to the next op, so we are at the correct position when the * generator is resumed. */ ZEND_VM_INC_OPCODE(); @@ -33594,6 +33551,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_A /* The GOTO VM uses a local opline variable. We need to set the opline * variable in execute_data so we don't resume at an old position. */ SAVE_OPLINE(); + ZEND_VM_RETURN(); } @@ -35536,13 +35494,10 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARG /* If a value is sent it should go into the result var */ generator->send_target = &EX_T(opline->result.var); - /* Initialize the sent value to NULL */ Z_ADDREF(EG(uninitialized_zval)); AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); - //CHECK_EXCEPTION(); - /* We increment to the next op, so we are at the correct position when the * generator is resumed. */ ZEND_VM_INC_OPCODE(); @@ -35550,6 +35505,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARG /* The GOTO VM uses a local opline variable. We need to set the opline * variable in execute_data so we don't resume at an old position. */ SAVE_OPLINE(); + ZEND_VM_RETURN(); } @@ -37872,13 +37828,10 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG /* If a value is sent it should go into the result var */ generator->send_target = &EX_T(opline->result.var); - /* Initialize the sent value to NULL */ Z_ADDREF(EG(uninitialized_zval)); AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); - //CHECK_EXCEPTION(); - /* We increment to the next op, so we are at the correct position when the * generator is resumed. */ ZEND_VM_INC_OPCODE(); @@ -37886,6 +37839,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG /* The GOTO VM uses a local opline variable. We need to set the opline * variable in execute_data so we don't resume at an old position. */ SAVE_OPLINE(); + ZEND_VM_RETURN(); } @@ -38873,13 +38827,10 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ /* If a value is sent it should go into the result var */ generator->send_target = &EX_T(opline->result.var); - /* Initialize the sent value to NULL */ Z_ADDREF(EG(uninitialized_zval)); AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); - //CHECK_EXCEPTION(); - /* We increment to the next op, so we are at the correct position when the * generator is resumed. */ ZEND_VM_INC_OPCODE(); @@ -38887,6 +38838,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ /* The GOTO VM uses a local opline variable. We need to set the opline * variable in execute_data so we don't resume at an old position. */ SAVE_OPLINE(); + ZEND_VM_RETURN(); } @@ -40877,13 +40829,10 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS /* If a value is sent it should go into the result var */ generator->send_target = &EX_T(opline->result.var); - /* Initialize the sent value to NULL */ Z_ADDREF(EG(uninitialized_zval)); AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); - //CHECK_EXCEPTION(); - /* We increment to the next op, so we are at the correct position when the * generator is resumed. */ ZEND_VM_INC_OPCODE(); @@ -40891,6 +40840,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS /* The GOTO VM uses a local opline variable. We need to set the opline * variable in execute_data so we don't resume at an old position. */ SAVE_OPLINE(); + ZEND_VM_RETURN(); }