Retract the PMOP cleanup patch: I'm seeing strange core dumps
Jarkko Hietaniemi [Tue, 6 Mar 2001 02:19:57 +0000 (02:19 +0000)]
with oddly familiar stack traces.

p4raw-id: //depot/perl@9054

op.c
op.h

diff --git a/op.c b/op.c
index 13fe21b..4c5dd13 100644 (file)
--- a/op.c
+++ b/op.c
@@ -843,29 +843,6 @@ S_op_clear(pTHX_ OP *o)
     case OP_MATCH:
     case OP_QR:
 clear_pmop:
-       {
-           HV *pmstash = PmopSTASH(cPMOPo);
-           if (pmstash) {
-               PMOP *pmop = HvPMROOT(pmstash);
-               PMOP *lastpmop = NULL;
-               while (pmop) {
-                   if (cPMOPo == pmop) {
-                       if (lastpmop)
-                           lastpmop->op_pmnext = pmop->op_pmnext;
-                       else
-                           HvPMROOT(pmstash) = pmop->op_pmnext;
-                       break;
-                   }
-                   lastpmop = pmop;
-                   pmop = pmop->op_pmnext;
-               }
-#ifdef USE_ITHREADS
-               Safefree(PmopSTASHPV(cPMOPo));
-#else
-               /* NOTE: PMOP.op_pmstash is not refcounted */
-#endif
-           }
-       }
        cPMOPo->op_pmreplroot = Nullop;
        ReREFCNT_dec(cPMOPo->op_pmregexp);
        cPMOPo->op_pmregexp = (REGEXP*)NULL;
@@ -2957,7 +2934,6 @@ Perl_newPMOP(pTHX_ I32 type, I32 flags)
     if (type != OP_TRANS && PL_curstash) {
        pmop->op_pmnext = HvPMROOT(PL_curstash);
        HvPMROOT(PL_curstash) = pmop;
-       PmopSTASH_set(pmop,PL_curstash);
     }
 
     return (OP*)pmop;
diff --git a/op.h b/op.h
index f3bc515..b1b11a5 100644 (file)
--- a/op.h
+++ b/op.h
@@ -242,11 +242,6 @@ struct pmop {
     U16                op_pmflags;
     U16                op_pmpermflags;
     U8         op_pmdynflags;
-#ifdef USE_ITHREADS
-    char *     op_pmstashpv;
-#else
-    HV *       op_pmstash;
-#endif
 };
 
 #define PMdf_USED      0x01            /* pm has been used once already */
@@ -276,20 +271,6 @@ struct pmop {
 /* mask of bits stored in regexp->reganch */
 #define PMf_COMPILETIME        (PMf_MULTILINE|PMf_SINGLELINE|PMf_LOCALE|PMf_FOLD|PMf_EXTENDED)
 
-#ifdef USE_ITHREADS
-#  define PmopSTASHPV(o)       ((o)->op_pmstashpv)
-#  define PmopSTASHPV_set(o,pv)        ((o)->op_pmstashpv = ((pv) ? savepv(pv) : Nullch))
-#  define PmopSTASH(o)         (PmopSTASHPV(o) \
-                                ? gv_stashpv(PmopSTASHPV(o),GV_ADD) : Nullhv)
-#  define PmopSTASH_set(o,hv)  PmopSTASHPV_set(o, (hv) ? HvNAME(hv) : Nullch)
-#else
-#  define PmopSTASH(o)         ((o)->op_pmstash)
-#  define PmopSTASH_set(o,hv)  ((o)->op_pmstash = (hv))
-#  define PmopSTASHPV(o)       (PmopSTASH(o) ? HvNAME(PmopSTASH(o)) : Nullch)
-   /* op_pmstash is not refcounted */
-#  define PmopSTASHPV_set(o,pv)        PmopSTASH_set((o), gv_stashpv(pv,GV_ADD))
-#endif
-
 struct svop {
     BASEOP
     SV *       op_sv;