File tree 1 file changed +17
-1
lines changed
1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -42,7 +42,23 @@ static void zend_generator_cleanup_unfinished_execution(zend_generator *generato
42
42
generator -> send_target = NULL ;
43
43
}
44
44
45
- zend_cleanup_unfinished_execution (execute_data , op_num , 0 );
45
+ {
46
+ /* There may be calls to zend_vm_stack_free_call_frame(), which modifies the VM stack
47
+ * globals, so need to load/restore those. */
48
+ zend_vm_stack original_stack = EG (vm_stack );
49
+ original_stack -> top = EG (vm_stack_top );
50
+ EG (vm_stack_top ) = generator -> stack -> top ;
51
+ EG (vm_stack_end ) = generator -> stack -> end ;
52
+ EG (vm_stack ) = generator -> stack ;
53
+
54
+ zend_cleanup_unfinished_execution (execute_data , op_num , 0 );
55
+
56
+ generator -> stack = EG (vm_stack );
57
+ generator -> stack -> top = EG (vm_stack_top );
58
+ EG (vm_stack_top ) = original_stack -> top ;
59
+ EG (vm_stack_end ) = original_stack -> end ;
60
+ EG (vm_stack ) = original_stack ;
61
+ }
46
62
}
47
63
/* }}} */
48
64
You can’t perform that action at this time.
0 commit comments