develooper Front page | perl.perl5.porters | Postings from February 2003

Re: [PATCH] jumbo closure fix

Thread Previous | Thread Next
From:
Dave Mitchell
Date:
February 27, 2003 10:34
Subject:
Re: [PATCH] jumbo closure fix
Message ID:
20030227183055.A18177@fdgroup.com
On Thu, Feb 27, 2003 at 03:34:47PM +0100, A Bergman wrote:
> 
> On torsdag, feb 27, 2003, at 14:20 Europe/Stockholm, Dave Mitchell 
> wrote:
> 
> >
> > I think the whole scheme falls apart if CVs can get modified later
> > (ie if a CV without any eval-like ops suddenly acquires some).
> > Can this happen?
> 
> Of course this can happen, everything can always happen, the only way 
> to stop it from happening is keeping the memory storing the cv in a 
> safe/locked non networked compartment  on the bottom of the sea (far 
> away from the likes of me and Simon :-). However don't let that stop 
> the scheme, all kinds of nasty XS hacks and B::Generate/optimize hacks 
> need to to do the correct thing, which is rewrite the CVs optree and 
> set the right flags or not add any eval like ops.

The only danger is if an already-compiled CV that has no eval-like
ops suddenly acuires some by some sort of late optimisation,
which sounds fairly unlikely, and this will only affect things if that
CV is (or is lexically enclosed within) an anon sub that isn't a closure,
which is itself within an anon that is a closure, and if the eval that gets
subsequently excuted tries to access a lexical that is declared within
the outer anon, in which case it won't find the lexical but will get a
warning that the variable 'is not available' instead.

I think I'll still sleep safe in my bed :-)

-- 
The optimist believes that he lives in the best of all possible worlds.
As does the pessimist.

Thread Previous | Thread Next


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