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

[perl #111462] refcount warnings from C<use strict> C<our %FIELDS>

Thread Previous
From:
Father Chrysostomos via RT
Date:
March 27, 2012 23:21
Subject:
[perl #111462] refcount warnings from C<use strict> C<our %FIELDS>
Message ID:
rt-3.6.HEAD-4610-1332915673-1187.111462-15-0@perl.org
On Mon Mar 26 23:13:23 2012, sprout wrote:
> On Mon Mar 26 16:51:02 2012, sprout wrote:
> > Because it’s freeing PL_main_root twice.  This one appears to work:
> > 
> > diff --git a/op.c b/op.c
> > index 2ffe10f..86ec54e 100644
> > --- a/op.c
> > +++ b/op.c
> > @@ -1496,14 +1496,17 @@ the tree thread-safe.
> >  void
> >  Perl_finalize_optree(pTHX_ OP* o)
> >  {
> > +    I32 i = PL_savestack_ix;
> >      PERL_ARGS_ASSERT_FINALIZE_OPTREE;
> >  
> > +    if (o != PL_main_root) SAVEFREEOP(o);
> >      ENTER;
> >      SAVEVPTR(PL_curcop);
> >  
> >      finalize_op(o);
> >  
> >      LEAVE;
> > +    PL_savestack_ix = i;
> >  }
> >  
> >  STATIC void
> > __END__
> 
> That cannot possibly work, as newATTRSUB calls
> finalize_optree(CvROOT(cv)), so finalize_optree is the wrong place to do
> this.

But if I put the same code in a different spot, so it only applied to
string eval, then it just works.  I’ve done so with commit 63429d5.

-- 

Father Chrysostomos


---
via perlbug:  queue: perl5 status: open
https://rt.perl.org:443/rt3/Ticket/Display.html?id=111462

Thread Previous


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