mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
Only backup vm_stack* if generator->stack has not been freed
This commit is contained in:
parent
2387771daf
commit
0445974cb1
1 changed files with 3 additions and 2 deletions
|
@ -322,13 +322,14 @@ ZEND_API void zend_generator_resume(zend_generator *generator) /* {{{ */
|
|||
zend_execute_ex(generator->execute_data);
|
||||
generator->flags &= ~ZEND_GENERATOR_CURRENTLY_RUNNING;
|
||||
|
||||
/* Unlink generator call_frame from the caller */
|
||||
/* Unlink generator call_frame from the caller and backup vm_stack_top */
|
||||
if (generator->execute_data) {
|
||||
generator->stack = EG(vm_stack);
|
||||
generator->stack->top = EG(vm_stack_top);
|
||||
generator->execute_data->prev_execute_data = NULL;
|
||||
}
|
||||
|
||||
/* Restore executor globals */
|
||||
generator->stack->top = EG(vm_stack_top);
|
||||
EG(current_execute_data) = original_execute_data;
|
||||
EG(scope) = original_scope;
|
||||
EG(vm_stack_top) = original_stack->top;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue