Z_ADDREF_P(val);
FREE_OP1();
- if (Z_ISUNDEF(new_gen->retval)) {
+ if (UNEXPECTED(new_gen->execute_data == NULL)) {
+ zend_throw_error(NULL, "Generator passed to yield from was aborted without proper return and is unable to continue");
+ zval_ptr_dtor(val);
+ UNDEF_RESULT();
+ HANDLE_EXCEPTION();
+ } else if (Z_ISUNDEF(new_gen->retval)) {
if (UNEXPECTED(zend_generator_get_current(new_gen) == generator)) {
zend_throw_error(NULL, "Impossible to yield from the Generator being currently run");
zval_ptr_dtor(val);
} else {
zend_generator_yield_from(generator, new_gen);
}
- } else if (UNEXPECTED(new_gen->execute_data == NULL)) {
- zend_throw_error(NULL, "Generator passed to yield from was aborted without proper return and is unable to continue");
- zval_ptr_dtor(val);
- UNDEF_RESULT();
- HANDLE_EXCEPTION();
} else {
if (RETURN_VALUE_USED(opline)) {
ZVAL_COPY(EX_VAR(opline->result.var), &new_gen->retval);
Z_ADDREF_P(val);
- if (Z_ISUNDEF(new_gen->retval)) {
+ if (UNEXPECTED(new_gen->execute_data == NULL)) {
+ zend_throw_error(NULL, "Generator passed to yield from was aborted without proper return and is unable to continue");
+ zval_ptr_dtor(val);
+ UNDEF_RESULT();
+ HANDLE_EXCEPTION();
+ } else if (Z_ISUNDEF(new_gen->retval)) {
if (UNEXPECTED(zend_generator_get_current(new_gen) == generator)) {
zend_throw_error(NULL, "Impossible to yield from the Generator being currently run");
zval_ptr_dtor(val);
} else {
zend_generator_yield_from(generator, new_gen);
}
- } else if (UNEXPECTED(new_gen->execute_data == NULL)) {
- zend_throw_error(NULL, "Generator passed to yield from was aborted without proper return and is unable to continue");
- zval_ptr_dtor(val);
- UNDEF_RESULT();
- HANDLE_EXCEPTION();
} else {
if (RETURN_VALUE_USED(opline)) {
ZVAL_COPY(EX_VAR(opline->result.var), &new_gen->retval);
Z_ADDREF_P(val);
zval_ptr_dtor_nogc(EX_VAR(opline->op1.var));
- if (Z_ISUNDEF(new_gen->retval)) {
+ if (UNEXPECTED(new_gen->execute_data == NULL)) {
+ zend_throw_error(NULL, "Generator passed to yield from was aborted without proper return and is unable to continue");
+ zval_ptr_dtor(val);
+ UNDEF_RESULT();
+ HANDLE_EXCEPTION();
+ } else if (Z_ISUNDEF(new_gen->retval)) {
if (UNEXPECTED(zend_generator_get_current(new_gen) == generator)) {
zend_throw_error(NULL, "Impossible to yield from the Generator being currently run");
zval_ptr_dtor(val);
} else {
zend_generator_yield_from(generator, new_gen);
}
- } else if (UNEXPECTED(new_gen->execute_data == NULL)) {
- zend_throw_error(NULL, "Generator passed to yield from was aborted without proper return and is unable to continue");
- zval_ptr_dtor(val);
- UNDEF_RESULT();
- HANDLE_EXCEPTION();
} else {
if (RETURN_VALUE_USED(opline)) {
ZVAL_COPY(EX_VAR(opline->result.var), &new_gen->retval);
Z_ADDREF_P(val);
- if (Z_ISUNDEF(new_gen->retval)) {
+ if (UNEXPECTED(new_gen->execute_data == NULL)) {
+ zend_throw_error(NULL, "Generator passed to yield from was aborted without proper return and is unable to continue");
+ zval_ptr_dtor(val);
+ UNDEF_RESULT();
+ HANDLE_EXCEPTION();
+ } else if (Z_ISUNDEF(new_gen->retval)) {
if (UNEXPECTED(zend_generator_get_current(new_gen) == generator)) {
zend_throw_error(NULL, "Impossible to yield from the Generator being currently run");
zval_ptr_dtor(val);
} else {
zend_generator_yield_from(generator, new_gen);
}
- } else if (UNEXPECTED(new_gen->execute_data == NULL)) {
- zend_throw_error(NULL, "Generator passed to yield from was aborted without proper return and is unable to continue");
- zval_ptr_dtor(val);
- UNDEF_RESULT();
- HANDLE_EXCEPTION();
} else {
if (RETURN_VALUE_USED(opline)) {
ZVAL_COPY(EX_VAR(opline->result.var), &new_gen->retval);