summaryrefslogtreecommitdiff
path: root/pp_hot.c
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2011-09-03 10:44:24 -0700
committerFather Chrysostomos <sprout@cpan.org>2011-09-03 10:55:45 -0700
commit33d4ef81b59b60428ca88cbc75a473f65b8e78a4 (patch)
tree23000ef9525c4e727f7c5e38c6c6932448e08ac5 /pp_hot.c
parenta19eaff605df318ab6a9dd2a13f03714eaf67ec8 (diff)
downloadperl-33d4ef81b59b60428ca88cbc75a473f65b8e78a4.tar.gz
Call get-magic once for CV-to-GV assignment
pp_rv2gv has already called get-magic, so pp_sassign should not do it at all. This is a regression from 5.8.8.
Diffstat (limited to 'pp_hot.c')
-rw-r--r--pp_hot.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/pp_hot.c b/pp_hot.c
index 758d334e62..6a22452b3b 100644
--- a/pp_hot.c
+++ b/pp_hot.c
@@ -125,6 +125,8 @@ PP(pp_sassign)
const U32 cv_type = SvTYPE(cv);
const bool is_gv = isGV_with_GP(right);
const bool got_coderef = cv_type == SVt_PVCV || cv_type == SVt_PVFM;
+ STRLEN len = 0;
+ const char *nambeg = is_gv ? NULL : SvPV_nomg_const(right, len);
if (!got_coderef) {
assert(SvROK(cv));
@@ -135,7 +137,9 @@ PP(pp_sassign)
context. */
if (!got_coderef && !is_gv && GIMME_V == G_VOID) {
/* Is the target symbol table currently empty? */
- GV * const gv = gv_fetchsv(right, GV_NOINIT, SVt_PVGV);
+ GV * const gv = gv_fetchpvn_flags(
+ nambeg, len, SvUTF8(right)|GV_NOINIT, SVt_PVGV
+ );
if (SvTYPE(gv) != SVt_PVGV && !SvOK(gv)) {
/* Good. Create a new proxy constant subroutine in the target.
The gv becomes a(nother) reference to the constant. */
@@ -153,7 +157,9 @@ PP(pp_sassign)
/* Need to fix things up. */
if (!is_gv) {
/* Need to fix GV. */
- right = MUTABLE_SV(gv_fetchsv(right, GV_ADD, SVt_PVGV));
+ right = MUTABLE_SV(gv_fetchpvn_flags(
+ nambeg, len, SvUTF8(right)|GV_ADD, SVt_PVGV
+ ));
}
if (!got_coderef) {