Commit Graph

185 Commits

Author SHA1 Message Date
Sammy Kaye Powers
478f119ab9 Update copyright headers to 2017 2017-01-04 11:14:55 -06:00
Bob Weinand
fcaccbaa22 Fix valgrind issue when throwing due to yield from aborted generator 2016-12-01 15:21:28 +01:00
Andrea Faulds
d690014bf3 Remove zpp fallback code (always use Fast ZPP)
Squashed commit of the following:

commit 3e27fbb3d2
Author: Andrea Faulds <ajf@ajf.me>
Date:   Sun Sep 11 19:14:37 2016 +0100

    Keep dummy FAST_ZPP macro for compatibility

commit 8a7cfd00de
Author: Andrea Faulds <ajf@ajf.me>
Date:   Mon Sep 5 22:36:03 2016 +0100

    Remove FAST_ZPP macro and plain zpp fallback code
2016-09-11 22:44:46 +01:00
Kalle Sommer Nielsen
8a1fbdda43 Fixed C89 build 2016-08-17 13:43:50 +02:00
Bob Weinand
6046acf93e Fix ClosedGeneratorException possibly thrown into wrong scope 2016-07-23 16:39:21 +02:00
Nikita Popov
aad4ecebf8 Fixed bug #71980 2016-04-07 12:29:59 +02:00
Bob Weinand
23b770f31f Fixed bug #71601 (finally block not executed after yield from) 2016-02-15 22:37:21 +01:00
Nikita Popov
1322672c0b Fix dangling send target when using yield from
Also drop some unnecessary TRY_DELREFs -- leftovers from the days
when null was refcounted.
2016-02-11 16:25:16 +01:00
Nikita Popov
aa3f44a395 Crude generator GC for value/key/retval
These values remain live after the generator has been closed, so
they are particularly susceptible to leaking cycles.
2016-02-10 19:03:02 +01:00
Bob Weinand
83cb751047 Fix accidental zval_dtor() usage 2016-01-07 15:12:50 +01:00
Bob Weinand
033d608771 Fixed bug #71297 (Memory leak with yield from) 2016-01-07 11:56:21 +01:00
Xinchen Hui
97a9470d97 bump year which is missed in rev 49493a2 2016-01-02 17:56:11 +08:00
Bob Weinand
559ede17e1 Fixed bug #71013 (Incorrect exception handler with yield from) 2015-12-06 02:45:19 +01:00
Bob Weinand
2de8915dea Fixed bug causing exception not being thrown immediately into a generator yielding from an array 2015-11-25 23:09:44 +01:00
Bob Weinand
73a92964ff Fixed bug #70965 (yield from with a common iterator primes too much) 2015-11-25 09:54:24 +01:00
Bob Weinand
80d9dcafe0 Fixed bug #70904 (yield from incorrectly marks valid generator as finished) 2015-11-24 23:43:34 +01:00
Bob Weinand
c9988a1e69 Remove superfluous branches 2015-09-20 02:59:30 +02:00
Bob Weinand
14af0f6dcb Set expectations in generator handling 2015-09-20 02:19:31 +02:00
Bob Weinand
5ece3ec71c Fix bogus traces with ReflectionGenerator::getTrace() 2015-08-20 23:24:28 +02:00
Dmitry Stogov
71af54e5f6 Mark error and exception functions as "cold" (Matt's idea) 2015-08-19 14:40:56 +03:00
Dmitry Stogov
715d5d2855 Get rid of implicit type casting in GC_*() macros in Zend/zend_types.h.
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.
2015-08-13 13:56:29 +03:00
Xinchen Hui
3eabf2bf19 "This" is C++ keyword 2015-07-30 11:30:34 +08:00
Aaron Piotrowski
5df893ce3c Use NULL where possible for exception class
Matches usage of zend_throw_exception()/zend_throw_exception_ex().
2015-07-07 12:10:55 -05:00
Aaron Piotrowski
22c38b2ef5 Remove need to pass error level 2015-07-03 17:53:41 -05:00
Aaron Piotrowski
5a99c07ecc Enable throwing custom exceptions from errors 2015-07-03 17:53:40 -05:00
Aaron Piotrowski
ed1b64877d Switch position of ce in exception ce variable names 2015-07-03 09:45:03 -05:00
Aaron Piotrowski
a812a74c2e Change zend_exception_get_default() to zend_exception_ce 2015-07-03 09:44:48 -05:00
Rasmus Lerdorf
41774bceff Fix more minor mistakes in the proto comments 2015-06-23 15:47:33 -04:00
Nikita Popov
ea5c66ec93 Avoid op_num = -1 in unfinished generator cleanup
Also add two tests showing that the -1 substraction in the
computation of op_num is really necessary.
2015-06-23 20:17:30 +02:00
Nikita Popov
f58ebb3609 Load/restore VM stack before unfinished generator cleanup 2015-06-20 19:09:25 +02:00
Nikita Popov
ddf41d3aeb Fix generator memory leak
Make sure HANDLE_EXCEPTION and generator unwinds stay in sync in
the future by extracting a common function.
2015-06-20 18:37:28 +02:00
Dmitry Stogov
1c754f0b71 Get rid of more ZVAL_ZVAL() macros 2015-06-12 13:33:14 +03:00
Dmitry Stogov
8e10e8f921 Avoid zval duplication in ZVAL_ZVAL() macro (it was necessary only in few places).
Switch from ZVAL_ZVAL() to simpler macros where possible (it makes sense to review remaining places)
2015-06-12 12:33:23 +03:00
Nikita Popov
580eb56fb7 Merge branch 'PHP-5.6'
Conflicts:
	Zend/zend_generators.c
2015-06-11 17:44:51 +02:00
Nikita Popov
8405265578 Fix bug #69740 2015-06-11 17:40:10 +02:00
Bob Weinand
c6a6b9746d Fix memleak in generators using symtable 2015-05-14 17:17:39 +02:00
Dmitry Stogov
bdbe121098 Fixed $this release 2015-05-07 17:26:01 +03:00
Bob Weinand
4376373da3 Fix yield from with iterator (first element missing) 2015-04-21 19:42:23 +02:00
Nikita Popov
9a0cb734a3 Fix memory error when throwing into a generator
throw_exception_internal will access opline+1, which is not always
defined at the current opline of the generator. To avoid this
decrement the opline before throwing (so the throw occurs at the
YIELD opcode instead of one after it).
2015-04-17 22:19:41 +02:00
Dmitry Stogov
a759967dd1 Mark call frames to closures with ZEND_CALL_CLOSURE flag to avoid expensive check at zend_leave_helper() 2015-04-16 12:16:03 +03:00
Bob Weinand
4e76d58b2b Fix object leak for yield from (added proper refcounting) 2015-04-15 21:42:27 +02:00
Bob Weinand
f3e124d58d Merge branch 'coroutineDelegation' of https://github.com/bwoebi/php-src 2015-04-14 17:58:58 +02:00
Nikita Popov
fc378a609a Fix leak of closure used as generator
Also remove obsolete code for copying the closure op_array. It
should no longer be possible for the closure object to be destroyed
while the generator is still live.
2015-04-08 21:11:42 +02:00
Dmitry Stogov
18f3d5490a Convert fatal error into EngineException 2015-04-01 13:49:11 +03:00
Dmitry Stogov
acfc31c0f8 Use zend_error_noreturn() for fatal errors 2015-04-01 13:32:23 +03:00
Nikita Popov
5c230baf75 Implement Generator::getReturn()
Conflicts:
	Zend/zend_vm_execute.h
2015-03-17 21:51:53 +01:00
Nikita Popov
4b930e156f Merge branch 'PHP-5.5' into PHP-5.6 2015-03-13 16:25:21 +01:00
Nikita Popov
a9d73f0646 Fixed bug #69221
A generator iterator can be created from different zvals - use
the object handle to manage references instead.
2015-03-13 16:23:53 +01:00
Dmitry Stogov
a30d328671 Errors converted to exceptions are not "recoverable" anymore. 2015-03-10 10:31:55 +03:00
Dmitry Stogov
1c94ff0595 Implement engine exceptions
RFC: https://wiki.php.net/rfc/engine_exceptions_for_php7

Pending changes regarding naming of BaseException and whether it
should be an interface.
2015-03-09 14:01:32 +01:00