summaryrefslogtreecommitdiff
path: root/gv.c
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2011-10-07 13:44:37 -0700
committerFather Chrysostomos <sprout@cpan.org>2011-10-07 14:38:26 -0700
commit61a9130e47c4757bccfe2496e1130f814aaec049 (patch)
tree6cc57561d3975e096bbf56905208db5e3e248917 /gv.c
parent13058d6734a1146f0910c93c897cabb1fb315975 (diff)
downloadperl-61a9130e47c4757bccfe2496e1130f814aaec049.tar.gz
Don’t put malformed UTF8 in $AUTOLOAD
Diffstat (limited to 'gv.c')
-rw-r--r--gv.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gv.c b/gv.c
index 24f4912a89..684f279737 100644
--- a/gv.c
+++ b/gv.c
@@ -1204,7 +1204,10 @@ Perl_gv_autoload_pvn(pTHX_ HV *stash, const char *name, STRLEN len, U32 flags)
sv_catpvs(varsv, "::");
/* Ensure SvSETMAGIC() is called if necessary. In particular, to clear
tainting if $FOO::AUTOLOAD was previously tainted, but is not now. */
- sv_catpvn_mg(varsv, name, len);
+ sv_catpvn_flags(
+ varsv, name, len,
+ SV_GMAGIC|SV_SMAGIC|(is_utf8 ? SV_CATUTF8 : SV_CATBYTES)
+ );
if (is_utf8)
SvUTF8_on(varsv);
return gv;