summaryrefslogtreecommitdiff
path: root/pp_ctl.c
diff options
context:
space:
mode:
Diffstat (limited to 'pp_ctl.c')
-rw-r--r--pp_ctl.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/pp_ctl.c b/pp_ctl.c
index f1c0669584..f121b7e453 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);
@@ -89,6 +90,15 @@ PP(pp_regcomp) {
else {
t = SvPV(tmpstr, len);
+#ifndef INCOMPLETE_TAINTS
+ if (tainting) {
+ if (tainted)
+ pm->op_pmdynflags |= PMdf_TAINTED;
+ else
+ pm->op_pmdynflags &= ~PMdf_TAINTED;
+ }
+#endif
+
/* Check against the last compiled regexp. */
if (!pm->op_pmregexp || !pm->op_pmregexp->precomp ||
pm->op_pmregexp->prelen != len ||