diff options
author | Gurusamy Sarathy <gsar@cpan.org> | 2000-04-16 16:51:08 +0000 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 2000-04-16 16:51:08 +0000 |
commit | f180df804d1cde858e3e94db2f42efcc697d07d9 (patch) | |
tree | 57059df321dc566c4fb334953a3265cfeb2f679e /gv.c | |
parent | cc0fca54a8335062a27e12be15bddf587362a0b0 (diff) | |
download | perl-f180df804d1cde858e3e94db2f42efcc697d07d9.tar.gz |
introduce illegal symbols into null package so that gv_fetchpv(...,TRUE)
always returns a valid GV even when the symbol is trapped by strictures
(avoids coredumps)
TODO: the C<package;> hack needs similar treatment
p4raw-id: //depot/perl@5908
Diffstat (limited to 'gv.c')
-rw-r--r-- | gv.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -520,7 +520,6 @@ Perl_gv_fetchpv(pTHX_ const char *nambeg, I32 add, I32 sv_type) I32 len; register const char *namend; HV *stash = 0; - U32 add_gvflags = 0; if (*name == '*' && isALPHA(name[1])) /* accidental stringify on a GV? */ name++; @@ -653,8 +652,10 @@ Perl_gv_fetchpv(pTHX_ const char *nambeg, I32 add, I32 sv_type) : sv_type == SVt_PVAV ? "@" : sv_type == SVt_PVHV ? "%" : ""), name)); + stash = PL_nullstash; } - return Nullgv; + else + return Nullgv; } if (!SvREFCNT(stash)) /* symbol table under destruction */ @@ -680,7 +681,6 @@ Perl_gv_fetchpv(pTHX_ const char *nambeg, I32 add, I32 sv_type) Perl_warner(aTHX_ WARN_INTERNAL, "Had to create %s unexpectedly", nambeg); gv_init(gv, stash, name, len, add & GV_ADDMULTI); gv_init_sv(gv, sv_type); - GvFLAGS(gv) |= add_gvflags; if (isLEXWARN_on && isALPHA(name[0]) && ! ckWARN(WARN_ONCE)) GvMULTI_on(gv) ; |