summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--embedvar.h4
-rw-r--r--gv.c6
-rw-r--r--intrpvar.h2
-rw-r--r--perl.c1
-rw-r--r--perlapi.h2
-rw-r--r--t/pragma/strict-vars2
6 files changed, 13 insertions, 4 deletions
diff --git a/embedvar.h b/embedvar.h
index e790976a18..889b4d44f2 100644
--- a/embedvar.h
+++ b/embedvar.h
@@ -322,6 +322,7 @@
#define PL_nomemok (PERL_GET_INTERP->Inomemok)
#define PL_nthreads (PERL_GET_INTERP->Inthreads)
#define PL_nthreads_cond (PERL_GET_INTERP->Inthreads_cond)
+#define PL_nullstash (PERL_GET_INTERP->Inullstash)
#define PL_numeric_local (PERL_GET_INTERP->Inumeric_local)
#define PL_numeric_name (PERL_GET_INTERP->Inumeric_name)
#define PL_numeric_radix (PERL_GET_INTERP->Inumeric_radix)
@@ -586,6 +587,7 @@
#define PL_nomemok (vTHX->Inomemok)
#define PL_nthreads (vTHX->Inthreads)
#define PL_nthreads_cond (vTHX->Inthreads_cond)
+#define PL_nullstash (vTHX->Inullstash)
#define PL_numeric_local (vTHX->Inumeric_local)
#define PL_numeric_name (vTHX->Inumeric_name)
#define PL_numeric_radix (vTHX->Inumeric_radix)
@@ -987,6 +989,7 @@
#define PL_nomemok (aTHXo->interp.Inomemok)
#define PL_nthreads (aTHXo->interp.Inthreads)
#define PL_nthreads_cond (aTHXo->interp.Inthreads_cond)
+#define PL_nullstash (aTHXo->interp.Inullstash)
#define PL_numeric_local (aTHXo->interp.Inumeric_local)
#define PL_numeric_name (aTHXo->interp.Inumeric_name)
#define PL_numeric_radix (aTHXo->interp.Inumeric_radix)
@@ -1252,6 +1255,7 @@
#define PL_Inomemok PL_nomemok
#define PL_Inthreads PL_nthreads
#define PL_Inthreads_cond PL_nthreads_cond
+#define PL_Inullstash PL_nullstash
#define PL_Inumeric_local PL_numeric_local
#define PL_Inumeric_name PL_numeric_name
#define PL_Inumeric_radix PL_numeric_radix
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) ;
diff --git a/intrpvar.h b/intrpvar.h
index 39d14c985e..8ed93f8fc9 100644
--- a/intrpvar.h
+++ b/intrpvar.h
@@ -443,3 +443,5 @@ PERLVAR(IProc, struct IPerlProc*)
#if defined(USE_ITHREADS)
PERLVAR(Iptr_table, PTR_TBL_t*)
#endif
+
+PERLVAR(Inullstash, HV *) /* illegal symbols end up here */
diff --git a/perl.c b/perl.c
index 578fafc3f1..04544b51e3 100644
--- a/perl.c
+++ b/perl.c
@@ -2425,6 +2425,7 @@ S_init_main_stash(pTHX)
CopSTASH_set(&PL_compiling, PL_defstash);
PL_debstash = GvHV(gv_fetchpv("DB::", GV_ADDMULTI, SVt_PVHV));
PL_globalstash = GvHV(gv_fetchpv("CORE::GLOBAL::", GV_ADDMULTI, SVt_PVHV));
+ PL_nullstash = GvHV(gv_fetchpv("<none>::", GV_ADDMULTI, SVt_PVHV));
/* We must init $/ before switches are processed. */
sv_setpvn(get_sv("/", TRUE), "\n", 1);
}
diff --git a/perlapi.h b/perlapi.h
index 5e5ac2825b..634634c047 100644
--- a/perlapi.h
+++ b/perlapi.h
@@ -382,6 +382,8 @@ START_EXTERN_C
#define PL_nthreads (*Perl_Inthreads_ptr(aTHXo))
#undef PL_nthreads_cond
#define PL_nthreads_cond (*Perl_Inthreads_cond_ptr(aTHXo))
+#undef PL_nullstash
+#define PL_nullstash (*Perl_Inullstash_ptr(aTHXo))
#undef PL_numeric_local
#define PL_numeric_local (*Perl_Inumeric_local_ptr(aTHXo))
#undef PL_numeric_name
diff --git a/t/pragma/strict-vars b/t/pragma/strict-vars
index ae09742fab..2ccfef7105 100644
--- a/t/pragma/strict-vars
+++ b/t/pragma/strict-vars
@@ -55,7 +55,7 @@ Execution of - aborted due to compilation errors.
# strict vars - error
use strict 'vars' ;
-$fred ;
+<$fred> ;
EXPECT
Global symbol "$fred" requires explicit package name at - line 4.
Execution of - aborted due to compilation errors.