summaryrefslogtreecommitdiff
path: root/gv.c
diff options
context:
space:
mode:
authorBrian Fraser <fraserbn@gmail.com>2011-09-25 22:15:55 -0700
committerFather Chrysostomos <sprout@cpan.org>2011-10-06 13:01:06 -0700
commit772d5078e19623501bc9e2e30401b270f2b64bcc (patch)
tree40033bb13cd2bb2fb414c1e2c880f01e202814ed /gv.c
parentc5540e1cf88a13d2e3c4bd0f68265301c762bc26 (diff)
downloadperl-772d5078e19623501bc9e2e30401b270f2b64bcc.tar.gz
gv.c: gv_fetchmeth_pvn UTF8 cleanup.
Since gv_fetchmeth_pvn is primarily used from within gv.c, and not much of anything is passing in the flag yet, this has no visible changes on the Perl level; So tests remain entirely in XS::APItest for the time being.
Diffstat (limited to 'gv.c')
-rw-r--r--gv.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/gv.c b/gv.c
index 91d88db9f0..0cc3207caf 100644
--- a/gv.c
+++ b/gv.c
@@ -665,7 +665,7 @@ Perl_gv_fetchmeth_pvn(pTHX_ HV *stash, const char *name, STRLEN len, I32 level,
topgen_cmp = HvMROMETA(stash)->cache_gen + PL_sub_generation;
/* check locally for a real method or a cache entry */
- gvp = (GV**)hv_fetch(stash, name, len, create);
+ gvp = (GV**)hv_fetch(stash, name, is_utf8 ? -len : len, create);
if(gvp) {
topgv = *gvp;
have_gv:
@@ -699,7 +699,8 @@ Perl_gv_fetchmeth_pvn(pTHX_ HV *stash, const char *name, STRLEN len, I32 level,
if (packlen >= 7 && strEQ(hvname + packlen - 7, "::SUPER")) {
HV* basestash;
packlen -= 7;
- basestash = gv_stashpvn(hvname, packlen, GV_ADD);
+ basestash = gv_stashpvn(hvname, packlen,
+ GV_ADD | (HvNAMEUTF8(stash) ? SVf_UTF8 : 0));
linear_av = mro_get_linear_isa(basestash);
}
else {
@@ -721,7 +722,7 @@ Perl_gv_fetchmeth_pvn(pTHX_ HV *stash, const char *name, STRLEN len, I32 level,
assert(cstash);
- gvp = (GV**)hv_fetch(cstash, name, len, 0);
+ gvp = (GV**)hv_fetch(cstash, name, is_utf8 ? -len : len, 0);
if (!gvp) {
if (len > 1 && HvNAMELEN_get(cstash) == 4) {
const char *hvname = HvNAME(cstash); assert(hvname);