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

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

From:
Steve Peters via RT
Date:
November 25, 2008 02:28
Subject:
[perl #38809] Bad return value from a block with variable localization
Message ID:
rt-3.6.HEAD-29153-1227594567-1682.38809-15-0@perl.org
On Mon Sep 29 10:59:21 2008, perl@profvince.com 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






nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About