summaryrefslogtreecommitdiff
path: root/sapi/tux/php_tux.c
diff options
context:
space:
mode:
authorNikita Popov <nikic@php.net>2013-12-01 13:37:56 +0100
committerNikita Popov <nikic@php.net>2013-12-01 13:37:56 +0100
commit02dca18b9045029e75d672b8667c1411dde5ca34 (patch)
tree34973a24e77e0323b89fd8e0a0cfb916160bd8d0 /sapi/tux/php_tux.c
parentaf60886962133e49662ee0e5090d04bf5705bdcc (diff)
downloadphp-git-02dca18b9045029e75d672b8667c1411dde5ca34.tar.gz
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.
Diffstat (limited to 'sapi/tux/php_tux.c')
0 files changed, 0 insertions, 0 deletions