?? ??? 2017, PHP 7.1.3
- Core:
+ . Fixed bug #74157 (Segfault with nested generators). (Laruence)
. Fixed bug #74164 (PHP hangs when an invalid value is dynamically passed to
typehinted by-ref arg). (Laruence)
. Fixed bug #74093 (Maximum execution time of n+2 seconds exceed not written
--- /dev/null
+--TEST--
+Bug #74157 (Segfault with nested generators)
+--FILE--
+<?php
+
+function a() {
+ $a = $b = $c = 2;
+ foreach(range(1, 5) as $v) {
+ yield $v;
+ }
+ return;
+}
+
+foreach (a(range(1, 3)) as $a) {
+ var_dump($a);
+}
+?>
+--EXPECTF--
+int(1)
+int(2)
+int(3)
+int(4)
+int(5)
* 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);
* 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);