cvs commit: ponie/perl pad.c

[email protected] (Nicholas Clark) 6 May 2005 09:55:33 -0000
Newsgroups perl.ponie.changes
Message-ID <[email protected]>
cvsuser     05/05/06 02:55:33

  Modified:    perl     pad.c
  Log:
  Assimilate patch 24402 from blead (avoid looking at a just freed CV)
  
  Revision  Changes    Path
  1.7       +4 -1      ponie/perl/pad.c
  
  Index: pad.c
  ===================================================================
  RCS file: /cvs/public/ponie/perl/pad.c,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- pad.c	19 Apr 2005 19:04:13 -0000	1.6
  +++ pad.c	6 May 2005 09:55:33 -0000	1.7
  @@ -260,14 +260,17 @@
   		&& *SvPVX(namesv) == '&')
   	    {
   		CV * const innercv = (CV*)curpad[ix];
  +		U32 inner_rc = SvREFCNT(innercv);
  +		assert(inner_rc);
   		namepad[ix] = Nullsv;
   		SvREFCNT_dec(namesv);
   
   		if (SvREFCNT(comppad) < 2) { /* allow for /(?{ sub{} })/  */
   		    curpad[ix] = Nullsv;
   		    SvREFCNT_dec(innercv);
  +		    inner_rc--;
   		}
  -		if (SvREFCNT(innercv) /* in use, not just a prototype */
  +		if (inner_rc /* in use, not just a prototype */
   		    && CvOUTSIDE(innercv) == cv)
   		{
   		    assert(CvWEAKOUTSIDE(innercv));