summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Ing-Simmons <nik@tiuk.ti.com>1999-10-24 20:54:06 +0000
committerNick Ing-Simmons <nik@tiuk.ti.com>1999-10-24 20:54:06 +0000
commit1ba752a043289c0682ba096aba08751ac71b298a (patch)
tree02c8a78ec34fd5c5c92d768857ac4dba2ed7e125
parent7ce18cd550b1bab2307a39ab5ca99680532c3fb2 (diff)
downloadperl-1ba752a043289c0682ba096aba08751ac71b298a.tar.gz
Avoid creating GV with NULL name when vivifying nameless scalars.
(Fix/workround for [ID19991024.001]) p4raw-id: //depot/perl@4444
-rw-r--r--pp.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/pp.c b/pp.c
index 8f4a156870..43a2e7c17e 100644
--- a/pp.c
+++ b/pp.c
@@ -245,8 +245,14 @@ PP(pp_rv2gv)
STRLEN len = 0;
char *name = "";
if (cUNOP->op_first->op_type == OP_PADSV) {
- SV *padname = *av_fetch(PL_comppad_name, cUNOP->op_first->op_targ, 4);
- name = SvPV(padname,len);
+ SV **namep = av_fetch(PL_comppad_name, cUNOP->op_first->op_targ, 4);
+ if (namep && *namep) {
+ name = SvPV(*namep,len);
+ if (!name) {
+ name = "";
+ len = 0;
+ }
+ }
}
gv_init(gv, PL_curcop->cop_stash, name, len, 0);
sv_upgrade(sv, SVt_RV);