mirror of
https://github.com/bdnugget/php-src.git
synced 2026-11-08 17:50:50 +00:00
Improved GENERATOR_CREATE opcode handler.
This commit is contained in:
1 parent
c2f25bd188
commit
9a159f37e1
3 files changed
+17
-4
No files matched your search
@@ -3,6 +3,7 @@ PHP NEWS
|
||||
?? ??? 2017, PHP 7.1.2
|
||||
|
||||
- Core:
|
||||
. Improved GENERATOR_CREATE opcode handler. (Bob, Dmitry)
|
||||
. Fixed bug #73877 (readlink() returns garbage for UTF-8 paths). (Anatol)
|
||||
. Fixed bug #73876 (Crash when exporting **= in expansion of assign op).
|
||||
(Sara)
|
||||
|
||||
+8
-2
@@ -4093,8 +4093,14 @@ ZEND_VM_HANDLER(41, ZEND_GENERATOR_CREATE, ANY, ANY)
|
||||
* is allocated on heap.
|
||||
*/
|
||||
num_args = EX_NUM_ARGS();
|
||||
used_stack = (ZEND_CALL_FRAME_SLOT + num_args + EX(func)->op_array.last_var + EX(func)->op_array.T - MIN(EX(func)->op_array.num_args, num_args)) * sizeof(zval);
|
||||
gen_execute_data = (zend_execute_data*)emalloc(used_stack);
|
||||
if (EXPECTED(num_args <= EX(func)->op_array.last_var)) {
|
||||
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);
|
||||
} else {
|
||||
used_stack = (ZEND_CALL_FRAME_SLOT + num_args + EX(func)->op_array.last_var + EX(func)->op_array.T - EX(func)->op_array.num_args) * sizeof(zval);
|
||||
gen_execute_data = (zend_execute_data*)emalloc(used_stack);
|
||||
}
|
||||
memcpy(gen_execute_data, execute_data, used_stack);
|
||||
|
||||
/* Save execution context in generator object. */
|
||||
|
||||
@@ -1179,8 +1179,14 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_GENERATOR_CREATE_SPEC_HANDLER(
|
||||
* is allocated on heap.
|
||||
*/
|
||||
num_args = EX_NUM_ARGS();
|
||||
used_stack = (ZEND_CALL_FRAME_SLOT + num_args + EX(func)->op_array.last_var + EX(func)->op_array.T - MIN(EX(func)->op_array.num_args, num_args)) * sizeof(zval);
|
||||
gen_execute_data = (zend_execute_data*)emalloc(used_stack);
|
||||
if (EXPECTED(num_args <= EX(func)->op_array.last_var)) {
|
||||
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);
|
||||
} else {
|
||||
used_stack = (ZEND_CALL_FRAME_SLOT + num_args + EX(func)->op_array.last_var + EX(func)->op_array.T - EX(func)->op_array.num_args) * sizeof(zval);
|
||||
gen_execute_data = (zend_execute_data*)emalloc(used_stack);
|
||||
}
|
||||
memcpy(gen_execute_data, execute_data, used_stack);
|
||||
|
||||
/* Save execution context in generator object. */
|
||||
|
||||
Reference in new issue
Block a user