diff options
author | Nick Ing-Simmons <nik@tiuk.ti.com> | 1999-10-24 20:54:06 +0000 |
---|---|---|
committer | Nick Ing-Simmons <nik@tiuk.ti.com> | 1999-10-24 20:54:06 +0000 |
commit | 1ba752a043289c0682ba096aba08751ac71b298a (patch) | |
tree | 02c8a78ec34fd5c5c92d768857ac4dba2ed7e125 | |
parent | 7ce18cd550b1bab2307a39ab5ca99680532c3fb2 (diff) | |
download | perl-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.c | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -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); |