1
0
mirror of https://github.com/php/php-src.git synced 2026-04-27 18:23:26 +02:00
Commit Graph

116 Commits

Author SHA1 Message Date
Dmitry Stogov 458c732ed4 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed calling generators through magic __call()
2016-11-28 12:30:01 +03:00
Dmitry Stogov 970f21be97 Fixed calling generators through magic __call() 2016-11-28 12:20:19 +03:00
Bob Weinand 35764e3579 Merge remote-tracking branch 'origin/PHP-7.0' into PHP-7.1 2016-07-23 16:40:02 +02:00
Bob Weinand 6046acf93e Fix ClosedGeneratorException possibly thrown into wrong scope 2016-07-23 16:39:21 +02:00
Nikita Popov e3e400c983 Fix return from by-ref generators 2016-07-14 15:44:04 +02:00
Xinchen Hui d1dd474ff9 Fixed bug #72523 (dtrace issue with reflection (failed test)) 2016-07-01 18:50:35 +08:00
Nikita Popov 79de9fa4aa Merge branch 'PHP-7.0'
Conflicts:
	Zend/zend_vm_execute.h
2016-05-28 13:22:49 +02:00
Nikita Popov 4746e5efcb Forbid "yield from" in force closed generators
Same check we do for "yield", was missed when "yield from" was
added. We could make this more granular by only forbidding to
actually yield values and still allow something like "yield from []",
but this does not seem worthwhile.
2016-05-28 13:21:05 +02:00
Dmitry Stogov 97bf4e0b12 Check if generator object is created by GENERATOR_CREATE when throw exceptions from generator function 2016-05-16 12:42:13 +03:00
Dmitry Stogov 414c4c6776 Revert "Check if generator object is created by GENERATOR_CREATE when throw exceptions from generator function."
This reverts commit a9b517c614.
2016-05-16 11:51:29 +03:00
Dmitry Stogov a9b517c614 Check if generator object is created by GENERATOR_CREATE when throw exceptions from generator function. 2016-05-16 10:24:13 +03:00
Dmitry Stogov 515a61069a Added test 2016-05-11 12:55:33 +03:00
Bob Weinand 5085352464 Fix generator being a cycle to itself 2016-04-18 23:55:16 +02:00
Dmitry Stogov e7730fece6 Fised possible use-after-free 2016-04-04 09:35:48 +03:00
Bob Weinand 23b770f31f Fixed bug #71601 (finally block not executed after yield from) 2016-02-15 22:37:21 +01:00
Nikita Popov ccc06e252b Forbid yield from in by-reference generators
The current yield from implementation doesn't support by-ref
yields. It's likely not worthwhile to actually implement this,
but we should at least keep the door open for the future by
issuing a compile error.

Refs bug #71252.
2016-02-12 17:55:29 +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
Bob Weinand 001ce475ee Fixed bug #71441 (Typehinted Generator with return in try/finally crashes) 2016-01-24 19:55:16 +01:00
Bob Weinand 033d608771 Fixed bug #71297 (Memory leak with yield from) 2016-01-07 11:56:21 +01:00
Levi Morrison 2a7eeff33e Remove mentions of "type hint" and "typehint" 2015-12-24 15:19:31 +01: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 7ca85d8875 Fully fix typed generator returns 2015-07-24 22:04:05 +02:00
Bob Weinand 2eb845d0fa Fix bug using not set temporary with typed generator returns 2015-07-24 20:31:18 +02: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 6a4877ee17 Add test for previous commit 2015-06-20 18:38:59 +02:00
Aaron Piotrowski e97d5fab35 Update exception names in tests after formatting changes. 2015-05-17 17:31:43 -05:00
Aaron Piotrowski fb7206e452 Merge branch 'master' into throwable-interface 2015-05-17 16:15:35 -05:00
Nikita Popov 3ae995f03c Tweak uncaught exception message display
This implements a reduced variant of #1226 with just the following
change:

-Fatal error: Uncaught exception 'EngineException' with message 'Call to private method foo::bar() from context ''' in %s:%d
+Fatal error: Uncaught EngineException: Call to private method foo::bar() from context '' in %s:%d

The '' wrapper around messages is very weird if the exception
message itself contains ''. Futhermore having the message wrapped
in '' doesn't work for the "and defined" suffix of
TypeExceptions.
2015-05-17 18:47:06 +02:00
Aaron Piotrowski 64b167d201 Updated tests to reflect exception class changes. 2015-05-16 16:49:14 -05:00
Nikita Popov c9f27ee422 Display EngineExceptions like ordinary exceptions
TypeException stays as-is for now because it uses messages that are
incompatible with the way exception messages are displayed.

closure_038.phpt and a few others now show that we're generating
too many exceptions for compound operations on undefined properties
-- this needs to be fixed in a followup.
2015-05-15 23:40:32 +02:00
Bob Weinand c6a6b9746d Fix memleak in generators using symtable 2015-05-14 17:17:39 +02:00
Dmitry Stogov fc75d07652 Fixed memory leak 2015-05-14 17:07:32 +03:00
Bob Weinand 4376373da3 Fix yield from with iterator (first element missing) 2015-04-21 19:42:23 +02:00
Bob Weinand 3dcad2eea2 Fix bug #69458 2015-04-15 21:56:11 +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 a7059f1eac Merge branch 'PHP-5.6'
Conflicts:
	Zend/zend_vm_def.h
	Zend/zend_vm_execute.h
2015-04-14 16:38:09 +02:00
Nikita Popov 95650d0942 Fixed bug #69419 2015-04-14 16:35:23 +02:00
Dmitry Stogov 18f3d5490a Convert fatal error into EngineException 2015-04-01 13:49:11 +03:00
Anthony Ferrara 1df033c5cd Revert gd and mysqli to former calls for arg count errors. Fix first identified issues with zend_compile.c from nikic. Add tests for generator returns prior to first yield 2015-03-18 16:14:02 -04:00
Anthony Ferrara d22bfb8aa6 Merge in master, fix merge conflicts and update patch to support exceptions everywhere 2015-03-18 10:50:11 -04:00
Nikita Popov 5c230baf75 Implement Generator::getReturn()
Conflicts:
	Zend/zend_vm_execute.h
2015-03-17 21:51: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
Bob Weinand b1cd381f01 Added test for bug #69160 (current behavior is correct) 2015-03-07 20:59:42 +01:00
Bob Weinand b4a142ab97 Added yield from operator 2015-03-07 00:28:12 +01:00
Nikita Popov 79f26e9ca5 Implement Generator::getReturn() 2015-02-19 20:25:49 +01:00
Anthony Ferrara e2053fa94c Fix bug where return type checking was overzealous and interfered with generators 2015-02-18 10:59:33 -05:00