develooper Front page | perl.perl5.porters | Postings from January 2012

[perl #8527] Freeing $_ in grep/map causes a double free

From:
Father Chrysostomos via RT
Date:
January 10, 2012 12:28
Subject:
[perl #8527] Freeing $_ in grep/map causes a double free
Message ID:
rt-3.6.HEAD-14510-1326227321-1254.8527-14-0@perl.org
On Tue Jan 10 12:26:11 2012, sprout wrote:
> On Sun Oct 10 17:59:54 2010, ikegami@adaelis.com wrote:
> > On Sun Oct 10 16:51:32 2010, sprout wrote:
> > > On Wed Feb 13 05:25:44 2002, sfink@digital-integrity.com wrote:
> > > > perl -e 'map{*_=5}1'
> > > > Attempt to free unreferenced scalar.
> > > 
> > > Is this the result of the stack’s not being reference-counted?
> > 
> > I think so. I've added a dependency to the meta ticket just in case.
> 
> Actually, it’s not.  It’s the result of the broken SAVE_DEFSV
> implementation which I fixed in commit 55b5114f.
> 
> It turns out that #92254 (which I reported after searching the perl
> source for SAVE_DEFSV) is a duplicate of this bug.
> 

Clarification: SAVE_DEFSV was causing *_{SCALAR} not to be
reference-counted, and operators like undef were not aware of that.

-- 

Father Chrysostomos




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