summaryrefslogtreecommitdiff
path: root/pp_hot.c
diff options
context:
space:
mode:
Diffstat (limited to 'pp_hot.c')
-rw-r--r--pp_hot.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/pp_hot.c b/pp_hot.c
index aa8d552c26..c43de40830 100644
--- a/pp_hot.c
+++ b/pp_hot.c
@@ -2016,7 +2016,6 @@ PP(pp_subst)
char *strend;
char *m;
const char *c;
- char *d;
STRLEN clen;
I32 iters = 0;
I32 maxiters;
@@ -2183,8 +2182,9 @@ PP(pp_subst)
orig = SvPV_force_nomg(TARG, len);
goto force_it;
}
- d = s;
+
if (once) {
+ char *d;
if (RX_MATCH_TAINTED(rx)) /* run time pattern taint, eg locale */
rxtainted |= SUBST_TAINT_PAT;
m = orig + RX_OFFS(rx)[0].start;
@@ -2223,6 +2223,7 @@ PP(pp_subst)
PUSHs(&PL_sv_yes);
}
else {
+ char *d = s;
do {
if (iters++ > maxiters)
DIE(aTHX_ "Substitution loop");