Skip to content

Commit

Permalink
Fix small mistake in generator creation introduced in 9a159f3
Browse files Browse the repository at this point in the history
  • Loading branch information
bwoebi committed Jan 15, 2017
1 parent ca4cfcc commit 9e3c35b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Zend/zend_vm_def.h
Original file line number Diff line number Diff line change
Expand Up @@ -3962,7 +3962,7 @@ ZEND_VM_HANDLER(41, ZEND_GENERATOR_CREATE, ANY, ANY)
* is allocated on heap.
*/
num_args = EX_NUM_ARGS();
if (EXPECTED(num_args <= EX(func)->op_array.last_var)) {
if (EXPECTED(num_args <= EX(func)->op_array.num_args)) {
used_stack = (ZEND_CALL_FRAME_SLOT + EX(func)->op_array.last_var + EX(func)->op_array.T) * sizeof(zval);
gen_execute_data = (zend_execute_data*)emalloc(used_stack);
used_stack = (ZEND_CALL_FRAME_SLOT + EX(func)->op_array.last_var) * sizeof(zval);
Expand Down
2 changes: 1 addition & 1 deletion Zend/zend_vm_execute.h
Original file line number Diff line number Diff line change
Expand Up @@ -1159,7 +1159,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_GENERATOR_CREATE_SPEC_HANDLER(
* is allocated on heap.
*/
num_args = EX_NUM_ARGS();
if (EXPECTED(num_args <= EX(func)->op_array.last_var)) {
if (EXPECTED(num_args <= EX(func)->op_array.num_args)) {
used_stack = (ZEND_CALL_FRAME_SLOT + EX(func)->op_array.last_var + EX(func)->op_array.T) * sizeof(zval);
gen_execute_data = (zend_execute_data*)emalloc(used_stack);
used_stack = (ZEND_CALL_FRAME_SLOT + EX(func)->op_array.last_var) * sizeof(zval);
Expand Down

0 comments on commit 9e3c35b

Please sign in to comment.