develooper Front page | perl.perl5.porters | Postings from August 2001

Re: [patch] ignore PL_curpm in PL_regex_padav cleanup

Thread Previous | Thread Next
From:
Doug MacEachern
Date:
August 4, 2001 09:41
Subject:
Re: [patch] ignore PL_curpm in PL_regex_padav cleanup
Message ID:
Pine.LNX.4.21.0108040939050.23972-100000@mako.covalent.net
On Sat, 4 Aug 2001, Arthur Bergman wrote:

> Problem is that PL_curpm changes after every match. So you would need to set
> and unset the SVf_BREAK flag every time you get a new PMOP.

my comments used the wrong variable name, s/PL_curpm/PL_reg_curpm/
for which the PL_regex_padav entry is only allocated once per interpreter:
        if (!PL_reg_curpm) {
        ...
                PL_reg_curpm->op_pmoffset = av_len(PL_regex_padav);

Index: perl.c
===================================================================
RCS file: /usr/local/cvs_repository/perl-current-mirror/perl.c,v
retrieving revision 1.1.1.43
diff -u -r1.1.1.43 perl.c
--- perl.c	2001/08/04 15:52:07	1.1.1.43
+++ perl.c	2001/08/04 15:58:12
@@ -481,7 +481,7 @@
             REGEXP *re = (REGEXP *)SvIVX(resv);
 
             if (SvFLAGS(resv) & SVf_BREAK) {
-                /* this is PL_curpm, already freed
+                /* this is PL_reg_curpm, already freed
                  * flag is set in regexec.c:S_regtry
                  */
                 SvFLAGS(resv) &= ~SVf_BREAK;
Index: regexec.c
===================================================================
RCS file: /usr/local/cvs_repository/perl-current-mirror/regexec.c,v
retrieving revision 1.1.1.26
diff -u -r1.1.1.26 regexec.c
--- regexec.c	2001/08/04 15:52:10	1.1.1.26
+++ regexec.c	2001/08/04 15:57:56
@@ -1855,7 +1855,7 @@
 #ifdef USE_ITHREADS
             {
                 SV* repointer = newSViv(0);
-                /* so we know which PL_regex_padav element is PL_curpm */
+                /* so we know which PL_regex_padav element is PL_reg_curpm */
                 SvFLAGS(repointer) |= SVf_BREAK;
                 av_push(PL_regex_padav,repointer);
                 PL_reg_curpm->op_pmoffset = av_len(PL_regex_padav);


Thread Previous | Thread Next


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