summaryrefslogtreecommitdiff
path: root/gv.c
diff options
context:
space:
mode:
authorBrian Fraser <fraserbn@gmail.com>2011-07-11 18:50:10 +0100
committerFather Chrysostomos <sprout@cpan.org>2011-10-06 13:01:19 -0700
commite0260a5b7a4c9245402af2910213dd35717e5bd2 (patch)
tree4a8e6fe940f71045523d4f2dd71cbe94c0aa1bb9 /gv.c
parenta180b31a163df6f094784ad4abcff6b8d80304d2 (diff)
downloadperl-e0260a5b7a4c9245402af2910213dd35717e5bd2.tar.gz
gv.c, op.c, pp.c: Stash-injected prototypes and prototype() are UTF-8 clean.
This makes perl -E '$::{example} = "\x{30cb}"; say prototype example;' store and fetch the correctly flagged prototype. With this, all TODO tests in gv.t pass; The next commit will deal with making the parsing of prototypes nul-clean.
Diffstat (limited to 'gv.c')
-rw-r--r--gv.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/gv.c b/gv.c
index f4b4b2a96b..c2bc883a5b 100644
--- a/gv.c
+++ b/gv.c
@@ -318,6 +318,7 @@ Perl_gv_init_pvn(pTHX_ GV *gv, HV *stash, const char *name, STRLEN len, U32 flag
const bool doproto = old_type > SVt_NULL;
char * const proto = (doproto && SvPOK(gv)) ? SvPVX(gv) : NULL;
const STRLEN protolen = proto ? SvCUR(gv) : 0;
+ const U32 proto_utf8 = proto ? SvUTF8(gv) : 0;
SV *const has_constant = doproto && SvROK(gv) ? SvRV(gv) : NULL;
const U32 exported_constant = has_constant ? SvPCS_IMPORTED(gv) : 0;
@@ -401,6 +402,7 @@ Perl_gv_init_pvn(pTHX_ GV *gv, HV *stash, const char *name, STRLEN len, U32 flag
if (proto) {
sv_usepvn_flags(MUTABLE_SV(cv), proto, protolen,
SV_HAS_TRAILING_NUL);
+ if ( proto_utf8 ) SvUTF8_on(MUTABLE_SV(cv));
}
}
}