Change 11790 by sky@sky-lab on 2001/08/30 08:22:31

        Introduces SvREPADTMP(sv) that marks a repad SvIV as a offset
        on the pad. Fixes coredumps in cleanups introduced by
        Change 11755  

Affected files ...

... //depot/perl/op.c#434 edit
... //depot/perl/perl.c#363 edit
... //depot/perl/sv.h#92 edit

Differences ...

==== //depot/perl/op.c#434 (text) ====
Index: perl/op.c
--- perl/op.c.~1~       Thu Aug 30 02:30:05 2001
+++ perl/op.c   Thu Aug 30 02:30:05 2001
@@ -864,6 +864,7 @@
 #ifdef USE_ITHREADS
        if(PL_regex_pad) {        /* We could be in destruction */
             av_push((AV*) PL_regex_pad[0],(SV*) PL_regex_pad[(cPMOPo)->op_pmoffset]);
+           SvREPADTMP_on(PL_regex_pad[(cPMOPo)->op_pmoffset]);
             PM_SETRE(cPMOPo, (cPMOPo)->op_pmoffset);
         }
 #endif 
@@ -2975,6 +2976,7 @@
         if(av_len((AV*) PL_regex_pad[0]) > -1) {
            repointer = av_pop((AV*)PL_regex_pad[0]);
             pmop->op_pmoffset = SvIV(repointer);
+           SvREPADTMP_off(repointer);
            sv_setiv(repointer,0);
         } else { 
             repointer = newSViv(0);

==== //depot/perl/perl.c#363 (text) ====
Index: perl/perl.c
--- perl/perl.c.~1~     Thu Aug 30 02:30:05 2001
+++ perl/perl.c Thu Aug 30 02:30:05 2001
@@ -496,7 +496,10 @@
                  * flag is set in regexec.c:S_regtry
                  */
                 SvFLAGS(resv) &= ~SVf_BREAK;
-            }
+            } 
+           else if(SvREPADTMP(resv)) {
+             SvREPADTMP_off(resv);
+           }
             else {
                 ReREFCNT_dec(re);
             }

==== //depot/perl/sv.h#92 (text) ====
Index: perl/sv.h
--- perl/sv.h.~1~       Thu Aug 30 02:30:05 2001
+++ perl/sv.h   Thu Aug 30 02:30:05 2001
@@ -703,6 +703,14 @@
 #define SvVALID_on(sv)         (SvFLAGS(sv) |= SVpbm_VALID)
 #define SvVALID_off(sv)                (SvFLAGS(sv) &= ~SVpbm_VALID)
 
+#ifdef USE_ITHREADS
+/* The following uses the FAKE flag to show that a regex pointer is infact
+   it's own offset in the regexpad for ithreads */
+#define SvREPADTMP(sv)         (SvFLAGS(sv) & SVf_FAKE)
+#define SvREPADTMP_on(sv)      (SvFLAGS(sv) |= SVf_FAKE)
+#define SvREPADTMP_off(sv)     (SvFLAGS(sv) &= ~SVf_FAKE)
+#endif
+
 #define SvRV(sv) ((XRV*)  SvANY(sv))->xrv_rv
 #define SvRVx(sv) SvRV(sv)
 
End of Patch.

Reply via email to