This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
eliminate PL_reginterp_cnt
authorDavid Mitchell <davem@iabyn.com>
Sun, 1 Apr 2012 12:14:09 +0000 (13:14 +0100)
committerDavid Mitchell <davem@iabyn.com>
Wed, 13 Jun 2012 12:32:51 +0000 (13:32 +0100)
This used to be the mechanism to determine whether "use re 'eval'" needed
to be in scope; but now that we make a clear distinction between literal
and runtime code blocks, it's no longer needed.

embedvar.h
intrpvar.h
pp_ctl.c
regcomp.c
sv.c

index 5245261..3922855 100644 (file)
 #define PL_regdummy            (vTHX->Iregdummy)
 #define PL_regex_pad           (vTHX->Iregex_pad)
 #define PL_regex_padav         (vTHX->Iregex_padav)
-#define PL_reginterp_cnt       (vTHX->Ireginterp_cnt)
 #define PL_registered_mros     (vTHX->Iregistered_mros)
 #define PL_regmatch_slab       (vTHX->Iregmatch_slab)
 #define PL_regmatch_state      (vTHX->Iregmatch_state)
index 0124f51..ffcac08 100644 (file)
@@ -296,8 +296,6 @@ PERLVAR(I, sawampersand, bool)              /* must save all match strings */
 PERLVAR(I, unsafe,     bool)
 PERLVAR(I, exit_flags, U8)             /* was exit() unexpected, etc. */
 
-PERLVARI(I, reginterp_cnt, I32,         0)     /* Whether "Regexp" was interpolated. */
-
 PERLVAR(I, inplace,    char *)
 PERLVAR(I, e_script,   SV *)
 
index 03eba7d..2734a2e 100644 (file)
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -69,9 +69,6 @@ PP(pp_wantarray)
 PP(pp_regcreset)
 {
     dVAR;
-    /* XXXX Should store the old value to allow for tie/overload - and
-       restore in regcomp, where marked with XXXX. */
-    PL_reginterp_cnt = 0;
     TAINT_NOT;
     return NORMAL;
 }
@@ -110,9 +107,6 @@ PP(pp_regcomp)
     assert (re != (REGEXP*) &PL_sv_undef);
     eng = re ? RX_ENGINE(re) : current_re_engine();
 
-    if (PL_op->op_flags & OPf_SPECIAL)
-       PL_reginterp_cnt = (I32_MAX>>1); /* Mark as safe.  */
-
     new_re = (eng->op_comp
                    ? eng->op_comp
                    : &Perl_re_op_compile
@@ -156,8 +150,6 @@ PP(pp_regcomp)
        PM_SETRE(pm, new_re);
     }
 
-    PL_reginterp_cnt = 0;      /* XXXX Be extra paranoid - needed
-                                  inside tie/overload accessors.  */
 #ifndef INCOMPLETE_TAINTS
     if (PL_tainting && PL_tainted) {
        SvTAINTED_on((SV*)new_re);
index 7827bb3..fc13f9d 100644 (file)
--- a/regcomp.c
+++ b/regcomp.c
@@ -5476,11 +5476,8 @@ Perl_re_op_compile(pTHX_ SV ** const patternp, int pat_count,
 
                }
                else {
-                   if (SvROK(msv) && SvTYPE(SvRV(msv)) == SVt_REGEXP) {
+                   if (SvROK(msv) && SvTYPE(SvRV(msv)) == SVt_REGEXP)
                        msv = SvRV(msv);
-                       PL_reginterp_cnt +=
-                           RX_SEEN_EVALS((REGEXP *)MUTABLE_PTR(msv));
-                   }
                    sv_catsv_nomg(pat, msv);
                    if (code)
                        pRExC_state->code_blocks[n-1].end = SvCUR(pat)-1;
diff --git a/sv.c b/sv.c
index fcd76a9..89f0f98 100644 (file)
--- a/sv.c
+++ b/sv.c
@@ -2839,7 +2839,6 @@ Perl_sv_2pv_flags(pTHX_ register SV *const sv, STRLEN *const lp, const I32 flags
                           || amagic_is_enabled(string_amg)
                          )) {
                    REGEXP * const re = (REGEXP *)MUTABLE_PTR(referent);
-                   I32 seen_evals = 0;
 
                    assert(re);
                        
@@ -2850,9 +2849,6 @@ Perl_sv_2pv_flags(pTHX_ register SV *const sv, STRLEN *const lp, const I32 flags
                    else
                        SvUTF8_off(sv); 
 
-                   if ((seen_evals = RX_SEEN_EVALS(re)))
-                       PL_reginterp_cnt += seen_evals;
-
                    if (lp)
                        *lp = RX_WRAPLEN(re);
  
@@ -13025,7 +13021,6 @@ perl_clone_using(PerlInterpreter *proto_perl, UV flags,
 
     /* RE engine related */
     Zero(&PL_reg_state, 1, struct re_save_state);
-    PL_reginterp_cnt   = 0;
     PL_regmatch_slab   = NULL;
 
     PL_sub_generation  = proto_perl->Isub_generation;