summaryrefslogtreecommitdiff
path: root/Zend/zend_generators.c
Commit message (Collapse)AuthorAgeFilesLines
* Fix generator GC if yield from parent chain does not reach rootNikita Popov2018-01-131-7/+7
| | | | | | | Parents may be unlinked while another generator sharing part of the chain is running. As such, we cannot assume that the parent chain goes all the way to the root. Instead walk backwards from root to leaf, like we also do during destruction.
* Try to fix yield from GC issuesNikita Popov2018-01-121-2/+4
| | | | | | | | Make sure we always update root and parent references before releasing the old root object. This fixes some crashes under aggressive cycle collection, so hopefully this will also fix bug #75351.
* Fixed bug #75396Nikita Popov2018-01-121-1/+2
| | | | | | Do not run finally blocks in generators on unclean shutdown (e.g. caused by exit). This is consistent with how finally blocks outside of generators behave.
* year++Xinchen Hui2018-01-021-1/+1
|
* Merge branch 'PHP-7.0' into PHP-7.1Bob Weinand2017-07-221-4/+2
|\
| * Fixed bug #74954 (null deref and segfault in zend_generator_resume())Bob Weinand2017-07-221-4/+2
| |
| * Update copyright headers to 2017Sammy Kaye Powers2017-01-041-1/+1
| |
* | Fixed bug #74606 (Segfault within try/catch/finally nesting in Generators)Bob Weinand2017-05-171-1/+1
| | | | | | | | Thanks to Nikita for pointing out the error source.
* | Update copyright headers to 2017Sammy Kaye Powers2017-01-041-1/+1
| |
* | Merge branch 'PHP-7.0' into PHP-7.1Bob Weinand2016-12-011-0/+1
|\ \ | |/
| * Fix valgrind issue when throwing due to yield from aborted generatorBob Weinand2016-12-011-0/+1
| |
* | fix exports which are now referenced by phpdbgAnatol Belski2016-09-281-2/+2
| | | | | | | | (cherry picked from commit cd0f1c8a5ed6d4e677dbf891fc69326e5b05cccc)
* | Add phpdbg generator commandBob Weinand2016-09-281-5/+5
| |
* | Merge branch 'PHP-7.0' into PHP-7.1Andrea Faulds2016-09-111-12/+0
|\ \ | |/
| * Remove zpp fallback code (always use Fast ZPP)Andrea Faulds2016-09-111-12/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Squashed commit of the following: commit 3e27fbb3d22b42d181e15c345f1c59a007b6b58c Author: Andrea Faulds <ajf@ajf.me> Date: Sun Sep 11 19:14:37 2016 +0100 Keep dummy FAST_ZPP macro for compatibility commit 8a7cfd00deaa4a3c5026c97580c49c886c72a5b4 Author: Andrea Faulds <ajf@ajf.me> Date: Mon Sep 5 22:36:03 2016 +0100 Remove FAST_ZPP macro and plain zpp fallback code
| * Fixed C89 buildKalle Sommer Nielsen2016-08-171-1/+2
| |
* | Merge remote-tracking branch 'origin/PHP-7.0' into PHP-7.1Bob Weinand2016-07-231-0/+10
|\ \ | |/
| * Fix ClosedGeneratorException possibly thrown into wrong scopeBob Weinand2016-07-231-0/+10
| |
* | Eliminated checks for (func->op_array.fn_flags & ZEND_ACC_GENERATOR) in fast ↵Dmitry Stogov2016-05-131-32/+0
| | | | | | | | | | | | | | path of DO_FCALL* handlers. This slightly improves calls to regular function and method calls in cost of a bit slower generator initialization. Separate call frame for generators, allocated on heap, now created by ZEND_GENERATOR_CREATE instruction.
* | Use main VM stack for generators. Only single call frame for generator ↵Dmitry Stogov2016-05-121-36/+81
| | | | | | | | itself is allocated on heap, call frames for nested functions are allocated on main VM stack. In case "yield" used in context of another function call, call stack has to be frozen and then restored.
* | Fixed compilation warningsDmitry Stogov2016-04-291-3/+4
| |
* | Don't initialize EX(call)->symbol_table on each function call.Dmitry Stogov2016-04-281-4/+8
| | | | | | | | Keep it uninitialized, and check ZEND_CALL_HAS_SYMBOL_TABLE flag when necessary.
* | - get rid of EG(scope). zend_get_executed_scope() should be used instead.Dmitry Stogov2016-04-281-4/+1
| | | | | | | | - ichanged zval_update_constant_ex(). Use IS_TYPE_IMMUTABLE flag on shared constants and AST, instead of "inline_change" parameter.
* | Fix generator being a cycle to itselfBob Weinand2016-04-181-4/+4
| |
* | Merge branch 'PHP-7.0'Nikita Popov2016-04-071-4/+8
|\ \ | |/
| * Fixed bug #71980Nikita Popov2016-04-071-4/+8
| |
* | Fised possible use-after-freeDmitry Stogov2016-04-041-2/+3
| |
* | Merge zend_execute_data->called_scope into zend_execute_data->This.Dmitry Stogov2016-04-011-4/+4
| | | | | | | | | | | | | | "called_scope" made sense only for static method calls, for dynamic calls it was always equal to the class of $this. Now EG(This) may store IS_OBJECT + $this or IS_UNUSED + "called_scope" (of course, "called_scope" may be NULL). Some code might need to be adopted to support this change. Checks (Z_OBJ(EX(This))) might need to be converted into (Z_TYPE(EX(This)) == IS_OBJECT).
* | Flags ZEND_CALL_RELEASE_THIS and ZEND_CALL_CLOSURE should never be set together.Dmitry Stogov2016-03-311-2/+2
| | | | | | | | Closures keep responsibility for releasing $this theirselves.
* | Fix buildKalle Sommer Nielsen2016-03-171-1/+2
| |
* | Merge branch 'PHP-7.0'Bob Weinand2016-02-151-20/+22
|\ \ | |/
| * Fixed bug #71601 (finally block not executed after yield from)Bob Weinand2016-02-151-16/+18
| |
* | Fix bug #69989Nikita Popov2016-02-121-5/+40
| | | | | | | | | | This should cover all the basic cycles. Anything further would require scanning the call stack and live temporaries.
* | Support partial GC for unfinished generatorsNikita Popov2016-02-111-2/+60
|/ | | | | This doesn't cover everything yet, but should be a good start for cycled in unfinished generators.
* Fix dangling send target when using yield fromNikita Popov2016-02-111-6/+0
| | | | | Also drop some unnecessary TRY_DELREFs -- leftovers from the days when null was refcounted.
* Crude generator GC for value/key/retvalNikita Popov2016-02-101-0/+10
| | | | | These values remain live after the generator has been closed, so they are particularly susceptible to leaking cycles.
* Fix accidental zval_dtor() usageBob Weinand2016-01-071-1/+1
|
* Fixed bug #71297 (Memory leak with yield from)Bob Weinand2016-01-071-1/+2
|
* bump year which is missed in rev 49493a2Xinchen Hui2016-01-021-1/+1
|
* Fixed bug #71013 (Incorrect exception handler with yield from)Bob Weinand2015-12-061-3/+12
|
* Fixed bug causing exception not being thrown immediately into a generator ↵Bob Weinand2015-11-251-0/+6
| | | | yielding from an array
* Fixed bug #70965 (yield from with a common iterator primes too much)Bob Weinand2015-11-251-5/+5
|
* Fixed bug #70904 (yield from incorrectly marks valid generator as finished)Bob Weinand2015-11-241-18/+13
|
* Remove superfluous branchesBob Weinand2015-09-201-9/+5
|
* Set expectations in generator handlingBob Weinand2015-09-201-52/+53
|
* Fix bogus traces with ReflectionGenerator::getTrace()Bob Weinand2015-08-201-1/+1
|
* Mark error and exception functions as "cold" (Matt's idea)Dmitry Stogov2015-08-191-1/+1
|
* Get rid of implicit type casting in GC_*() macros in Zend/zend_types.h.Dmitry Stogov2015-08-131-1/+1
| | | | | | This prevented compilation warnings and disclosed few incorrect usages in Zend/zend_vm_def.h and ext/dom/xpath.c. Now explicit type casting may be required on call site. This may break some C extension code, but it shoulfn't be a problem to add explicit casting.
* "This" is C++ keywordXinchen Hui2015-07-301-4/+4
|
* Use NULL where possible for exception classAaron Piotrowski2015-07-071-2/+2
| | | | Matches usage of zend_throw_exception()/zend_throw_exception_ex().