Skip to content

Commit 9e3c35b

Browse files
committed
Fix small mistake in generator creation introduced in 9a159f3
1 parent ca4cfcc commit 9e3c35b

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Zend/zend_vm_def.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3962,7 +3962,7 @@ ZEND_VM_HANDLER(41, ZEND_GENERATOR_CREATE, ANY, ANY)
39623962
* is allocated on heap.
39633963
*/
39643964
num_args = EX_NUM_ARGS();
3965-
if (EXPECTED(num_args <= EX(func)->op_array.last_var)) {
3965+
if (EXPECTED(num_args <= EX(func)->op_array.num_args)) {
39663966
used_stack = (ZEND_CALL_FRAME_SLOT + EX(func)->op_array.last_var + EX(func)->op_array.T) * sizeof(zval);
39673967
gen_execute_data = (zend_execute_data*)emalloc(used_stack);
39683968
used_stack = (ZEND_CALL_FRAME_SLOT + EX(func)->op_array.last_var) * sizeof(zval);

Zend/zend_vm_execute.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1159,7 +1159,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_GENERATOR_CREATE_SPEC_HANDLER(
11591159
* is allocated on heap.
11601160
*/
11611161
num_args = EX_NUM_ARGS();
1162-
if (EXPECTED(num_args <= EX(func)->op_array.last_var)) {
1162+
if (EXPECTED(num_args <= EX(func)->op_array.num_args)) {
11631163
used_stack = (ZEND_CALL_FRAME_SLOT + EX(func)->op_array.last_var + EX(func)->op_array.T) * sizeof(zval);
11641164
gen_execute_data = (zend_execute_data*)emalloc(used_stack);
11651165
used_stack = (ZEND_CALL_FRAME_SLOT + EX(func)->op_array.last_var) * sizeof(zval);

0 commit comments

Comments
 (0)