summaryrefslogtreecommitdiff
path: root/gv.c
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>2000-04-16 16:51:08 +0000
committerGurusamy Sarathy <gsar@cpan.org>2000-04-16 16:51:08 +0000
commitf180df804d1cde858e3e94db2f42efcc697d07d9 (patch)
tree57059df321dc566c4fb334953a3265cfeb2f679e /gv.c
parentcc0fca54a8335062a27e12be15bddf587362a0b0 (diff)
downloadperl-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.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/gv.c b/gv.c
index be1935560e..5ab21b1383 100644
--- a/gv.c
+++ b/gv.c
@@ -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) ;