X-Git-Url: https://perl5.git.perl.org/perl5.git/blobdiff_plain/c80a8618143e98aed6d9e5bbaee16d0308e211d0..2a98b8cbbc6f75b5aaefb10acc4da4427359fcea:/op.c diff --git a/op.c b/op.c index 3c5079a..abf1a81 100644 --- a/op.c +++ b/op.c @@ -10934,9 +10934,9 @@ S_already_defined(pTHX_ CV *const cv, OP * const block, OP * const o, const line_t oldline = CopLINE(PL_curcop); SV *namesv = o ? cSVOPo->op_sv - : sv_2mortal(newSVpvn_utf8( - PadnamePV(name)+1,PadnameLEN(name)-1, PadnameUTF8(name) - )); + : newSVpvn_flags( PadnamePV(name)+1,PadnameLEN(name)-1, + (PadnameUTF8(name)) ? SVf_UTF8|SVs_TEMP : SVs_TEMP + ); if (PL_parser && PL_parser->copline != NOLINE) /* This ensures that warnings are reported at the first line of a redefinition, not the last. */