X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=pp_ctl.c;h=96e852e50ab59b89f2086b5407449eb95a1bb78b;hb=dcb4812c733545a68ef39b77c2dc4f7d440de203;hp=f1c06695840fd5b95bc940140db26b4cd967991e;hpb=b3ac6de7f0c7a63b73f1cf3ea9e371470f7d1cb0;p=p5sagit%2Fp5-mst-13.2.git diff --git a/pp_ctl.c b/pp_ctl.c index f1c0669..96e852e 100644 --- a/pp_ctl.c +++ b/pp_ctl.c @@ -67,7 +67,8 @@ PP(pp_regcmaybe) return NORMAL; } -PP(pp_regcomp) { +PP(pp_regcomp) +{ djSP; register PMOP *pm = (PMOP*)cLOGOP->op_other; register char *t; @@ -76,12 +77,12 @@ PP(pp_regcomp) { MAGIC *mg = Null(MAGIC*); tmpstr = POPs; - if(SvROK(tmpstr)) { + if (SvROK(tmpstr)) { SV *sv = SvRV(tmpstr); if(SvMAGICAL(sv)) mg = mg_find(sv, 'r'); } - if(mg) { + if (mg) { regexp *re = (regexp *)mg->mg_obj; ReREFCNT_dec(pm->op_pmregexp); pm->op_pmregexp = ReREFCNT_inc(re); @@ -104,6 +105,15 @@ PP(pp_regcomp) { } } +#ifndef INCOMPLETE_TAINTS + if (tainting) { + if (tainted) + pm->op_pmdynflags |= PMdf_TAINTED; + else + pm->op_pmdynflags &= ~PMdf_TAINTED; + } +#endif + if (!pm->op_pmregexp->prelen && curpm) pm = curpm; else if (strEQ("\\s+", pm->op_pmregexp->precomp)) @@ -145,7 +155,6 @@ PP(pp_substcont) SV *targ = cx->sb_targ; sv_catpvn(dstr, s, cx->sb_strend - s); - TAINT_IF(cx->sb_rxtainted || RX_MATCH_TAINTED(rx)); cx->sb_rxtainted |= RX_MATCH_TAINTED(rx); (void)SvOOK_off(targ);