This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Away with REXEC_SCREAM!
authorFather Chrysostomos <sprout@cpan.org>
Thu, 24 May 2012 21:45:41 +0000 (14:45 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Wed, 30 May 2012 06:55:23 +0000 (23:55 -0700)
Actually, we cannot remove the definition, as there are CPAN modules
that need it; but they only test the flag, and never set it, so perl
doesn’t need to keep testing it itself.

pp_ctl.c
pp_hot.c
regexec.c

index 271dfb2..2ccd812 100644 (file)
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -302,13 +302,6 @@ PP(pp_substcont)
        s -= RX_GOFS(rx);
 
        /* Are we done */
-       /* I believe that we can't set REXEC_SCREAM here if
-          SvSCREAM(cx->sb_targ) is true because SvPVX(cx->sb_targ) isn't always
-          equal to s.  [See the comment before Perl_re_intuit_start(), which is
-          called from Perl_regexec_flags(), which says that it should be when
-          SvSCREAM() is true.]  s, cx->sb_strend and orig will be consistent
-          with SvPVX(cx->sb_targ), as substconst doesn't modify cx->sb_targ
-          during the match.  */
        if (CxONCE(cx) || s < orig ||
                !CALLREGEXEC(rx, s, cx->sb_strend, orig,
                             (s == m) + RX_GOFS(rx), cx->sb_targ, NULL,
index f663e32..c9aa778 100644 (file)
--- a/pp_hot.c
+++ b/pp_hot.c
@@ -1357,9 +1357,6 @@ PP(pp_match)
        if ( (RX_EXTFLAGS(rx) & RXf_CHECK_ALL)
             && !PL_sawampersand
             && !(RX_EXTFLAGS(rx) & RXf_PMf_KEEPCOPY)
-            && ((RX_EXTFLAGS(rx) & RXf_NOSCAN)
-                || !((RX_EXTFLAGS(rx) & RXf_INTUIT_TAIL)
-                     && (r_flags & REXEC_SCREAM)))
             && !SvROK(TARG))   /* Cannot trust since INTUIT cannot guess ^ */
            goto yup;
     }
@@ -2152,10 +2149,7 @@ PP(pp_subst)
        /* How to do it in subst? */
 /*     if ( (RX_EXTFLAGS(rx) & RXf_CHECK_ALL)
             && !PL_sawampersand
-            && !(RX_EXTFLAGS(rx) & RXf_KEEPCOPY)
-            && ((RX_EXTFLAGS(rx) & RXf_NOSCAN)
-                || !((RX_EXTFLAGS(rx) & RXf_INTUIT_TAIL)
-                     && (r_flags & REXEC_SCREAM))))
+            && !(RX_EXTFLAGS(rx) & RXf_KEEPCOPY))
            goto yup;
 */
     }
index 3b85d8b..084b496 100644 (file)
--- a/regexec.c
+++ b/regexec.c
@@ -2327,9 +2327,6 @@ Perl_regexec_flags(pTHX_ REGEXP * const rx, char *stringarg, register char *stre
                (s = fbm_instr((unsigned char*)HOP3(s, back_min, (back_min<0 ? strbeg : strend)),
                                  (unsigned char*)strend, must,
                                  multiline ? FBMrf_MULTILINE : 0)) ) {
-           /* we may be pointing at the wrong string */
-           if ((flags & REXEC_SCREAM) && RXp_MATCH_COPIED(prog))
-               s = strbeg + (s - SvPVX_const(sv));
            DEBUG_EXECUTE_r( did_match = 1 );
            if (HOPc(s, -back_max) > last1) {
                last1 = HOPc(s, -back_min);