summaryrefslogtreecommitdiff
path: root/doop.c
diff options
context:
space:
mode:
Diffstat (limited to 'doop.c')
-rw-r--r--doop.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/doop.c b/doop.c
index 5972dbd2a6..08b6c230a7 100644
--- a/doop.c
+++ b/doop.c
@@ -1197,6 +1197,8 @@ Perl_do_vop(pTHX_ I32 optype, SV *sv, SV *left, SV *right)
rsave = rc = SvPV_nomg_const(right, rightlen);
len = leftlen < rightlen ? leftlen : rightlen;
lensave = len;
+ SvCUR_set(sv, len);
+ (void)SvPOK_only(sv);
if ((left_utf || right_utf) && (sv == left || sv == right)) {
needlen = optype == OP_BIT_AND ? len : leftlen + rightlen;
Newxz(dc, needlen + 1, char);
@@ -1217,8 +1219,6 @@ Perl_do_vop(pTHX_ I32 optype, SV *sv, SV *left, SV *right)
sv_usepvn_flags(sv, dc, needlen, SV_HAS_TRAILING_NUL);
dc = SvPVX(sv); /* sv_usepvn() calls Renew() */
}
- SvCUR_set(sv, len);
- (void)SvPOK_only(sv);
if (left_utf || right_utf) {
UV duc, luc, ruc;
char *dcorig = dc;