New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't undef active subroutine #18606
Comments
I've reproduced this and I see what's happening. Lexical subs have the SV* for their pad entry copied into the new pad (with an The leads to a more subtle problem too:
Note that the outer b() (bound to where $x is 1) is called, but the inner recursive b() instance (where $x is 2) is used instead, for example with this non-lexical-sub equivalent:
|
Hi, Any thoughts about what to do about this? If I understand, lexical subs can not currently be used with recursion which re-enters the scope where the lexical sub is defined, because the recursive call will not create a new closure (or not properly). Is that right? If there is no solution possible, then it might be best to document the limitation in perlsub.
|
I'll take another look, I suspect now I was trying to solve some non-existent problems last time I tried to fix this. |
This previously put the same CV into the inner pad, so on a recursive call into the owning sub, from this sub, this CV would still be active, and the attempt to clone into the still busy CV would throw. Fixes Perl#18606 but definitely needs more tests.
@tonycoz, have you been able to look into this problem any further? |
This previously put the same CV into the inner pad, so on a recursive call into the owning sub, from this sub, this CV would still be active, and the attempt to clone into the still busy CV would throw. Fixes Perl#18606
This previously put the same CV into the inner pad, so on a recursive call into the owning sub, from this sub, this CV would still be active, and the attempt to clone into the still busy CV would throw. Fixes Perl#18606
This previously put the same CV into the inner pad, so on a recursive call into the owning sub, from this sub, this CV would still be active, and the attempt to clone into the still busy CV would throw an error. Fixes Perl#18606
This previously put the same CV into the inner pad, so on a recursive call into the owning sub, from this sub, this CV would still be active, and the attempt to clone into the still busy CV would throw an error. Fixes #18606
Should this produce: "deep recursion" not: "Can't undef active subroutine" ?
The text was updated successfully, but these errors were encountered: