This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
[perl #122829] Flip-flop under recursion
authorFather Chrysostomos <sprout@cpan.org>
Tue, 28 Oct 2014 21:34:28 +0000 (14:34 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Wed, 29 Oct 2014 00:46:59 +0000 (17:46 -0700)
commit00e40766a52e90fea69000c44dbc74c62133f696
tree100273e23abc69ce985d28da8a00070b2977834d
parentebe6eeaa0bc3a3ef60bc8a046621fd57729b08cd
[perl #122829] Flip-flop under recursion

Each recursion level of a sub was maintaining separate states for
flip-flop operators within the sub, contrary to the documentation.

This commit makes different recursion levels share the same internal
state.  Closures have been keeping separate state, so I have preserved
that behaviour.  This makes flip-flop state have the same scope as
state variables, so the pad entries used by flip-flop operators can be
allocated just like state vars.
op.c
pad.c
t/op/flip.t