php-src/Zend/tests/generators
Nikita Popov 02dca18b90 Fix bug #65764
I'm not exactly sure whether this is the right way to fix it. The
question is whether Generator::throw() on a newborn generator (i.e.
a generator that is not yet at yield expression) should first advance to
the first yield and throw the exception there or whether it should
instead throw the exception in the caller's context.

The old behavior was to throw it at the start of the function (i.e.
the very first opcode), which causes issues like the one in #65764.
Effectively it's impossible to properly handle the exceptions in this
case.

For now I choose the variant where the generator advances to the
first yield before throwing, as that's consistent with how all other
methods on the Generator object currently behave. This does not
necessarily match the behavior in other languages, e.g. Python would throw
the exception in the caller's context. But then our send() method already
has this kind of deviation, so it stays internally consistent at least.
2013-12-01 13:37:56 +01:00
..
errors Fix tests after laruence unserialize change 2013-03-09 20:21:33 +01:00
finally Fix potential segfault when finally in a generator is run during shutdown 2013-01-30 23:52:02 +01:00
auto_incrementing_keys.phpt Remove asterix modifier (*) for generators 2012-07-20 16:09:06 +02:00
backtrace.phpt Fix throwing of exceptions within a generator 2012-07-22 17:46:46 +02:00
bug63066.phpt Fixed bug #63066 (Calling an undefined method in a generator results in a seg fault) (fixed with previous commit). 2012-11-30 14:14:36 +04:00
bug65035.phpt Don't try to clean up generator stack on unclean shutdown 2013-06-29 21:51:54 +02:00
bug65161.phpt Don't try to clean up generator stack on unclean shutdown 2013-06-29 21:51:54 +02:00
bug66041.phpt Fixed bug #66041: list() fails to unpack yielded ArrayAccess object 2013-11-30 13:08:31 +01:00
clone.phpt Remove support for cloning generators 2013-03-29 11:42:10 +01:00
dynamic_call.phpt Remove asterix modifier (*) for generators 2012-07-20 16:09:06 +02:00
fibonacci.phpt Add some more tests 2012-07-20 17:40:04 +02:00
func_get_args.phpt Remove asterix modifier (*) for generators 2012-07-20 16:09:06 +02:00
generator_closure_with_this.phpt Add some more tests 2012-07-20 17:40:04 +02:00
generator_closure.phpt Add some more tests 2012-07-20 17:40:04 +02:00
generator_in_multipleiterator.phpt Fix implementation of Iterator interface 2012-07-26 17:13:25 +02:00
generator_method_by_ref.phpt Remove asterix modifier (*) for generators 2012-07-20 16:09:06 +02:00
generator_method.phpt Remove asterix modifier (*) for generators 2012-07-20 16:09:06 +02:00
generator_returns_generator.phpt Remove asterix modifier (*) for generators 2012-07-20 16:09:06 +02:00
generator_rewind.phpt Fix segfault when traversing a by-ref generator twice 2012-08-29 20:46:56 +02:00
generator_send.phpt Remove asterix modifier (*) for generators 2012-07-20 16:09:06 +02:00
generator_static_method.phpt Add some more tests 2012-07-20 17:40:04 +02:00
generator_throwing_during_function_call.phpt Remove asterix modifier (*) for generators 2012-07-20 16:09:06 +02:00
generator_throwing_exception.phpt Remove asterix modifier (*) for generators 2012-07-20 16:09:06 +02:00
generator_throwing_in_foreach.phpt Fix throwing of exceptions within a generator 2012-07-22 17:46:46 +02:00
generator_with_keys.phpt Remove asterix modifier (*) for generators 2012-07-20 16:09:06 +02:00
generator_with_nonscalar_keys.phpt Add support for non-scalar Iterator keys in foreach 2013-03-12 17:27:31 +01:00
ignored_send_leak.phpt Fix leak when generator ignores sent value 2012-12-18 21:39:02 +01:00
nested_calls_with_die.phpt Fix bug #63830: Segfault on undefined function call in nested generator 2013-02-01 19:53:04 +01:00
nested_method_calls.phpt Remove support for cloning generators 2013-03-29 11:42:10 +01:00
no_foreach_var_leaks.phpt Remove asterix modifier (*) for generators 2012-07-20 16:09:06 +02:00
send_after_close.phpt Remove asterix modifier (*) for generators 2012-07-20 16:09:06 +02:00
send_returns_current.phpt Require parenthesis around yield expressions 2012-07-22 01:22:22 +02:00
throw_already_closed.phpt Implement Generator::throw() method 2012-12-24 00:27:55 +01:00
throw_caught.phpt Fix bug #65764 2013-12-01 13:37:56 +01:00
throw_not_an_exception.phpt Implement Generator::throw() method 2012-12-24 00:27:55 +01:00
throw_rethrow.phpt Fix bug #65764 2013-12-01 13:37:56 +01:00
throw_uncaught.phpt Implement Generator::throw() method 2012-12-24 00:27:55 +01:00
unused_return_value.phpt Remove asterix modifier (*) for generators 2012-07-20 16:09:06 +02:00
xrange.phpt Remove asterix modifier (*) for generators 2012-07-20 16:09:06 +02:00
yield_array_key.phpt Fix leak when yielding array as key 2012-09-01 20:31:40 +02:00
yield_array_offset_by_ref.phpt Require parenthesis around yield expressions 2012-07-22 01:22:22 +02:00
yield_by_reference.phpt Remove reference restrictions from foreach 2012-07-22 14:33:25 +02:00
yield_closure.phpt Fix crash when last yielded value is a closure 2012-12-21 17:28:20 +01:00
yield_during_function_call.phpt Remove asterix modifier (*) for generators 2012-07-20 16:09:06 +02:00
yield_during_method_call.phpt Remove support for cloning generators 2013-03-29 11:42:10 +01:00
yield_in_finally.phpt Fix several issues and allow rewind only at/before first yield 2012-08-25 17:40:08 +02:00
yield_in_parenthesis.phpt Require parenthesis around yield expressions 2012-07-22 01:22:22 +02:00
yield_ref_function_call_by_reference.phpt Remove asterix modifier (*) for generators 2012-07-20 16:09:06 +02:00
yield_without_value.phpt Merge branch 'pull-request/341' 2013-06-10 14:30:59 -07:00