From: Nikita Popov Date: Fri, 28 Sep 2018 17:17:43 +0000 (+0200) Subject: Merge branch 'PHP-7.2' into PHP-7.3 X-Git-Tag: php-7.3.0RC3~35 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7189e0b70f54b313dd4fe310d4bf3e1dfe6ec95d;p=php Merge branch 'PHP-7.2' into PHP-7.3 --- 7189e0b70f54b313dd4fe310d4bf3e1dfe6ec95d diff --cc NEWS index 74dd935014,eb845cbe69..1f48fb5f17 --- a/NEWS +++ b/NEWS @@@ -5,16 -5,11 +5,17 @@@ PH - Core: . Fixed bug #76846 (Segfault in shutdown function after memory limit error). (Nikita) + . Fixed bug #76946 (Cyclic reference in generator not detected). (Nikita) -11 Oct 2018, PHP 7.2.11 +27 Sep 2018, PHP 7.3.0RC2 + +- CURL: + . Fixed bug #76480 (Use curl_multi_wait() so that timeouts are respected). + (Pierrick) - Core: + . Fixed bug #76869 (Incorrect bypassing protected method accessibilty check). + (Dmitry) . Fixed bug #76800 (foreach inconsistent if array modified during loop). (Dmitry) . Fixed bug #76901 (method_exists on SPL iterator passthrough method corrupts diff --cc Zend/zend_generators.c index 0198b3171e,666a12fdeb..1162c7653f --- a/Zend/zend_generators.c +++ b/Zend/zend_generators.c @@@ -339,9 -356,26 +358,26 @@@ static HashTable *zend_generator_get_gc ZVAL_OBJ(gc_buffer++, Z_OBJ(execute_data->This)); } if (EX_CALL_INFO() & ZEND_CALL_CLOSURE) { - ZVAL_OBJ(gc_buffer++, (zend_object *) EX(func)->common.prototype); + ZVAL_OBJ(gc_buffer++, ZEND_CLOSURE_OBJECT(EX(func))); } + if (execute_data->opline != op_array->opcodes) { + uint32_t i, op_num = execute_data->opline - op_array->opcodes - 1; + for (i = 0; i < op_array->last_live_range; i++) { + const zend_live_range *range = &op_array->live_range[i]; + if (range->start > op_num) { + break; + } else if (op_num < range->end) { + uint32_t kind = range->var & ZEND_LIVE_MASK; + uint32_t var_num = range->var & ~ZEND_LIVE_MASK; + zval *var = EX_VAR(var_num); + if (kind == ZEND_LIVE_TMPVAR || kind == ZEND_LIVE_LOOP) { + ZVAL_COPY_VALUE(gc_buffer++, var); + } + } + } + } + if (generator->node.children == 0) { zend_generator *root = generator->node.ptr.root; while (root != generator) {