cvs commit: ponie/src/pmc perl5pvgv.pmc

[email protected] (Nicholas Clark) 11 May 2005 22:44:18 -0000
Newsgroups perl.ponie.changes
Message-ID <[email protected]>
cvsuser     05/05/11 15:44:17

  Modified:    src/pmc  perl5pvgv.pmc
  Log:
  Seems that we need this defence to avoid lots of bleating on FreBSD - must
  be bugs actually becoming exposed due to hash ordering effects, rather than
  FreeBSD actualy being bad.
  
  Revision  Changes    Path
  1.9       +14 -1     ponie/src/pmc/perl5pvgv.pmc
  
  Index: perl5pvgv.pmc
  ===================================================================
  RCS file: /cvs/public/ponie/src/pmc/perl5pvgv.pmc,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- perl5pvgv.pmc	4 May 2005 16:44:30 -0000	1.8
  +++ perl5pvgv.pmc	11 May 2005 22:44:17 -0000	1.9
  @@ -108,6 +108,19 @@
                   SV *sv = MUMBLE(SELF);
                   HV *stash = GvSTASH(sv);
   
  +                if (stash) {
  +                    /* The stash holds a reference to us. It we try to delete
  +                       our entry in the stash then it will recursively try to
  +                       delete us.  */
  +                    SV **in_stash = hv_fetch(stash, GvNAME(sv), GvNAMELEN(sv),
  +                                             0);
  +                    if (in_stash) {
  +                        /* For some reason this isn't true. Figure this out. */
  +                        /*assert(*in_stash == sv);*/
  +                        *in_stash = &PL_sv_placeholder;
  +                    }
  +                }
  +
                   Ponie_freescalar_common_magic(sv);
                   gp_free((GV*)sv);
                   Safefree(GvNAME(sv));