summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pp_hot.c12
-rwxr-xr-xt/op/tie.t7
2 files changed, 2 insertions, 17 deletions
diff --git a/pp_hot.c b/pp_hot.c
index 8502c1c9a1..813b606b0b 100644
--- a/pp_hot.c
+++ b/pp_hot.c
@@ -148,14 +148,11 @@ PP(pp_concat)
dPOPTOPssrl;
bool lbyte;
STRLEN rlen;
- const char *rpv;
- bool rbyte;
+ const char *rpv = SvPV_const(right, rlen); /* mg_get(right) happens here */
+ const bool rbyte = !DO_UTF8(right);
bool rcopied = FALSE;
if (TARG == right && right != left) {
- /* mg_get(right) may happen here ... */
- rpv = SvPV_const(right, rlen);
- rbyte = !DO_UTF8(right);
right = sv_2mortal(newSVpvn(rpv, rlen));
rpv = SvPV_const(right, rlen); /* no point setting UTF-8 here */
rcopied = TRUE;
@@ -182,11 +179,6 @@ PP(pp_concat)
SvUTF8_off(TARG);
}
- /* or mg_get(right) may happen here */
- if (!rcopied) {
- rpv = SvPV_const(right, rlen);
- rbyte = !DO_UTF8(right);
- }
if (lbyte != rbyte) {
if (lbyte)
sv_utf8_upgrade_nomg(TARG);
diff --git a/t/op/tie.t b/t/op/tie.t
index 8cb45398ad..1fe37e1624 100755
--- a/t/op/tie.t
+++ b/t/op/tie.t
@@ -578,10 +578,3 @@ tie $h, "main";
print $h,"\n";
EXPECT
3.3
-########
-sub TIESCALAR { bless {} }
-sub FETCH { shift()->{i} ++ }
-tie $h, "main";
-print $h.$h;
-EXPECT
-01