summaryrefslogtreecommitdiff
path: root/pp_hot.c
diff options
context:
space:
mode:
authorDavid Mitchell <davem@iabyn.com>2010-07-02 21:33:01 +0100
committerDavid Mitchell <davem@iabyn.com>2010-07-03 16:25:58 +0100
commitc5aa2872379824e696683293ee3de5762325de1e (patch)
tree281fa18ce92cfc817d633083f41f21b0a3651f4b /pp_hot.c
parent895b760f672897cb301e8900c05743c32f282f42 (diff)
downloadperl-c5aa2872379824e696683293ee3de5762325de1e.tar.gz
remove double stringify-overload from $ovld .= foo
There was a piece of code in pp_concat who's job it was to determine the UT8ness of the LHS, and it did it in a heavy-handed way to cope with the special case of a regexp (which is an RV pointing to REGEXP which might be UTF8)
Diffstat (limited to 'pp_hot.c')
-rw-r--r--pp_hot.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/pp_hot.c b/pp_hot.c
index 29928d7201..0e529215a3 100644
--- a/pp_hot.c
+++ b/pp_hot.c
@@ -255,14 +255,13 @@ PP(pp_concat)
SvUTF8_off(TARG);
}
else { /* TARG == left */
- STRLEN llen;
if (!SvOK(TARG)) {
if (left == right && ckWARN(WARN_UNINITIALIZED))
report_uninit(right);
sv_setpvs(left, "");
}
- (void)SvPV_nomg_const(left, llen); /* Needed to set UTF8 flag */
- lbyte = !DO_UTF8(left);
+ lbyte = (SvROK(left) && SvTYPE(SvRV(left)) == SVt_REGEXP)
+ ? !DO_UTF8(SvRV(left)) : !DO_UTF8(left);
if (IN_BYTES)
SvUTF8_off(TARG);
}