Yet Another Copying-Without-Paying-Attention-To-SvUTF8(sv) Bug
Jarkko Hietaniemi [Mon, 4 Dec 2000 19:44:09 +0000 (19:44 +0000)]
uncovered by #7980.

p4raw-id: //depot/perl@7982

op.c

diff --git a/op.c b/op.c
index 50db696..5d00c69 100644 (file)
--- a/op.c
+++ b/op.c
@@ -6778,6 +6778,8 @@ Perl_peep(pTHX_ register OP *o)
            if ((!SvFAKE(sv = *svp) || !SvREADONLY(sv)) && !IS_PADCONST(sv)) {
                key = SvPV(sv, keylen);
                lexname = newSVpvn_share(key, keylen, 0);
+               if (SvUTF8(sv))
+                   SvUTF8_on(lexname);
                SvREFCNT_dec(sv);
                *svp = lexname;
            }