summaryrefslogtreecommitdiff
path: root/pp_hot.c
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>2000-05-28 06:39:53 +0000
committerGurusamy Sarathy <gsar@cpan.org>2000-05-28 06:39:53 +0000
commitc9d5ac959cdfa7a668b3bfbbc2b56923c316ef43 (patch)
tree3e4852c2cfd7989934271082cbe99ae944741cae /pp_hot.c
parent9983fa3c886b6f0a857997142e62341929a9b601 (diff)
downloadperl-c9d5ac959cdfa7a668b3bfbbc2b56923c316ef43.tar.gz
change#2879 broke rvalue autovivification of magicals such as ${$num}
(reworked variant of patch suggested by Simon Cozens) p4raw-link: @2879 on //depot/perl: 35cd451c5a1303394968903750cc3b3a1a6bc892 p4raw-id: //depot/perl@6126
Diffstat (limited to 'pp_hot.c')
-rw-r--r--pp_hot.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/pp_hot.c b/pp_hot.c
index 2a8aa9b0c5..6bec999b98 100644
--- a/pp_hot.c
+++ b/pp_hot.c
@@ -462,7 +462,7 @@ PP(pp_rv2av)
if (SvTYPE(sv) != SVt_PVGV) {
char *sym;
- STRLEN n_a;
+ STRLEN len;
if (SvGMAGICAL(sv)) {
mg_get(sv);
@@ -481,13 +481,17 @@ PP(pp_rv2av)
}
RETSETUNDEF;
}
- sym = SvPV(sv,n_a);
+ sym = SvPV(sv,len);
if ((PL_op->op_flags & OPf_SPECIAL) &&
!(PL_op->op_flags & OPf_MOD))
{
gv = (GV*)gv_fetchpv(sym, FALSE, SVt_PVAV);
- if (!gv)
+ if (!gv
+ && (!is_gv_magical(sym,len,0)
+ || !(gv = (GV*)gv_fetchpv(sym, TRUE, SVt_PVAV))))
+ {
RETSETUNDEF;
+ }
}
else {
if (PL_op->op_private & HINT_STRICT_REFS)
@@ -562,7 +566,7 @@ PP(pp_rv2hv)
if (SvTYPE(sv) != SVt_PVGV) {
char *sym;
- STRLEN n_a;
+ STRLEN len;
if (SvGMAGICAL(sv)) {
mg_get(sv);
@@ -581,13 +585,17 @@ PP(pp_rv2hv)
}
RETSETUNDEF;
}
- sym = SvPV(sv,n_a);
+ sym = SvPV(sv,len);
if ((PL_op->op_flags & OPf_SPECIAL) &&
!(PL_op->op_flags & OPf_MOD))
{
gv = (GV*)gv_fetchpv(sym, FALSE, SVt_PVHV);
- if (!gv)
+ if (!gv
+ && (!is_gv_magical(sym,len,0)
+ || !(gv = (GV*)gv_fetchpv(sym, TRUE, SVt_PVHV))))
+ {
RETSETUNDEF;
+ }
}
else {
if (PL_op->op_private & HINT_STRICT_REFS)