> Am 22.01.2016 um 15:43 schrieb Dmitry Stogov <dmi...@zend.com>:
> 
> 
> Hi,
> 
> Could you please, take a look into the PoC.
> It's incomplete, but may be you get ideas how to fix this.
> 
> https://gist.github.com/dstogov/285024375d15cacf2a9b 
> <https://gist.github.com/dstogov/285024375d15cacf2a9b>
> 
> Few tests are failed, because YIELD may be used as expression in nested calls 
> (between INIT_FCALL/DO_FCALL), and the caller function restores 
> EG(vm_stack_top), loosing and overwriting that active frame.
> 
> <?php
> function gen() {
>     var_dump(yield 1);
> }
> 
> for ($gen = gen(); $gen->valid(); $gen->send(0)) {
>     var_dump($gen->current());
> }
> ?>
> 
> Thanks. Dmitry.

Hey, that's pretty similar to what I did 
https://github.com/php/php-src/commit/0f0471a9893230918084798d4e35db37d7b4519d 
<https://github.com/php/php-src/compare/master...bwoebi:stackless_generators> 
in that old patch, which you rejected because we hadn't found any solution for 
that issue with yield inside calls.

We basically need a way to properly first fetch the args (beware: func_arg 
fetches...) before instantiating the call frame, an issue which for example 
could be solved if we applied my vm_stack_restructuring patch (because it only 
installs call frames after all args were fetched).

I believe this patch won't work without significant refactoring (like 
vm_stack_refactoring branch) … so, either we bite the bullet and look at that 
patch again, or we can forget this idea too.

Thanks,
Bob

Reply via email to