From: Bob Weinand Date: Sun, 15 Jan 2017 18:26:15 +0000 (+0100) Subject: Fix small mistake in generator creation introduced in 9a159f37 X-Git-Tag: php-7.2.0alpha1~527 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9e3c35b6d16c8e6b54567e952834a0d817c97f88;p=php Fix small mistake in generator creation introduced in 9a159f37 --- diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h index 569e1c0717..563022b8d7 100644 --- a/Zend/zend_vm_def.h +++ b/Zend/zend_vm_def.h @@ -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); diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h index f6ebd5f297..8f28209d53 100644 --- a/Zend/zend_vm_execute.h +++ b/Zend/zend_vm_execute.h @@ -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);