Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/PHP-7.0' into PHP-7.1
Browse files Browse the repository at this point in the history
  • Loading branch information
bwoebi committed Jul 23, 2016
2 parents 696d6e7 + 6046acf commit 35764e3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
7 changes: 3 additions & 4 deletions Zend/tests/generators/mutli_yield_from_with_exception.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,10 @@ Stack trace:
#2 %s(%d): Generator->next()
#3 {main}
Generator 1

Fatal error: Uncaught ClosedGeneratorException: Generator yielded from aborted, no return value available in %s:%d
Caught exception!
ClosedGeneratorException: Generator yielded from aborted, no return value available in %s:%d
Stack trace:
#0 [internal function]: gen(Object(Generator))
#1 %s(%d): Generator->current()
#2 {main}
thrown in %s on line %d

NULL
10 changes: 10 additions & 0 deletions Zend/zend_generators.c
Original file line number Diff line number Diff line change
Expand Up @@ -635,6 +635,16 @@ ZEND_API zend_generator *zend_generator_update_current(zend_generator *generator
zend_throw_exception(zend_ce_ClosedGeneratorException, "Generator yielded from aborted, no return value available", 0);

EG(current_execute_data) = original_execute_data;

if (!((old_root ? old_root : generator)->flags & ZEND_GENERATOR_CURRENTLY_RUNNING)) {
leaf->node.ptr.root = root;
root->node.parent = NULL;
if (old_root) {
OBJ_RELEASE(&old_root->std);
}
zend_generator_resume(leaf);
return leaf->node.ptr.root; /* this may be updated during zend_generator_resume! */
}
} else {
zval_ptr_dtor(&root->value);
ZVAL_COPY(&root->value, &root->node.parent->value);
Expand Down

0 comments on commit 35764e3

Please sign in to comment.