develooper Front page | perl.perl5.porters | Postings from November 2008

[perl #38809] Bad return value from a block with variable localization

Steve Peters via RT
November 25, 2008 02:28
[perl #38809] Bad return value from a block with variable localization
Message ID:
On Mon Sep 29 10:59:21 2008, wrote:
> Attached is another patch for 38809. It does essentially two things.
> - Mark ENTER ops that follows a return as SPECIAL at compile time.
> - Set the gimme value of those blocks in pp_enter as the caller's one.
> It's very similar to the previous one, except that it used to look for
> the caller context in LEAVE instead of ENTER, which made it impossible
> to handle cases like
>     return do { 1; do { 2; @a } }
> This is fixed with this version.
> I'm not feeling that easy by looking at the caller's context in
> pp_enter, but we need this information to solve the problem, and we need
> it there, so I'm afraid it's the only way to get over it (besides
> ignoring the bug :) ).
> Tests included, ok with blead.

Thanks!  I've applied this patch as change #34907.

Steve Peters Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About