From: Nick Ing-Simmons Date: Sun, 24 Oct 1999 20:54:06 +0000 (+0000) Subject: Avoid creating GV with NULL name when vivifying nameless scalars. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=1ba752a043289c0682ba096aba08751ac71b298a;p=p5sagit%2Fp5-mst-13.2.git Avoid creating GV with NULL name when vivifying nameless scalars. (Fix/workround for [ID19991024.001]) p4raw-id: //depot/perl@4444 --- diff --git a/pp.c b/pp.c index 8f4a156..43a2e7c 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);