develooper Front page | perl.perl5.porters | Postings from February 2003

Re: [perl #20683] [fix] /(??{$x})/ ignore any changes made to $x

Thread Previous | Thread Next
From:
Enache Adrian
Date:
February 22, 2003 16:16
Subject:
Re: [perl #20683] [fix] /(??{$x})/ ignore any changes made to $x
Message ID:
20030223001643.GB26587@ratsnest.hole
On Sat, Feb 22, 2003 at 09:22:21PM +0200, Enache Adrian wrote:
> Please try the patch below ( you'll have to run make regen_headers too)
> 

Please add this too to the previous patch - I deleted it by error from the
diff -rup output.
(without it, I suspect that the regexp caching will be defeated in
_all_ cases).

------------------------------------------------------------------------
--- /arc/perl-current/regexec.c	2003-02-16 16:24:51.000000000 +0200
+++ perl-current/regexec.c	2003-02-23 01:43:04.000000000 +0200
@@ -2863,18 +2863,12 @@ S_regmatch(pTHX_ regnode *prog)
 	    if (logical) {
 		if (logical == 2) {	/* Postponed subexpression. */
 		    regexp *re;
-		    MAGIC *mg = Null(MAGIC*);
+		    MAGIC *mg;
 		    re_cc_state state;
 		    CHECKPOINT cp, lastcp;
                     int toggleutf;
-
-		    if(SvROK(ret) || SvRMAGICAL(ret)) {
-			SV *sv = SvROK(ret) ? SvRV(ret) : ret;
-
-			if(SvMAGICAL(sv))
-			    mg = mg_find(sv, PERL_MAGIC_qr);
-		    }
-		    if (mg) {
+		    SV *sv = SvROK(ret) ? SvRV(ret) : ret;
+		    if(SvMAGICAL(sv) && (mg = mg_find(sv, PERL_MAGIC_qr))) {
 			re = (regexp *)mg->mg_obj;
 			(void)ReREFCNT_inc(re);
 		    }
------------------------------------------------------------------------

Regards
Adi

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