summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cpan/Devel-PPPort/parts/inc/variables4
-rw-r--r--embedvar.h2
-rw-r--r--gv.c2
-rw-r--r--hv.c2
-rw-r--r--intrpvar.h2
-rw-r--r--mg.c2
-rw-r--r--pad.c2
-rw-r--r--perl.c1
-rw-r--r--perl.h7
-rw-r--r--sv.c1
-rw-r--r--util.c4
11 files changed, 17 insertions, 12 deletions
diff --git a/cpan/Devel-PPPort/parts/inc/variables b/cpan/Devel-PPPort/parts/inc/variables
index 515e6200a4..77b088ef58 100644
--- a/cpan/Devel-PPPort/parts/inc/variables
+++ b/cpan/Devel-PPPort/parts/inc/variables
@@ -383,7 +383,11 @@ other_variables()
ppp_TESTVAR(PL_debstash);
ppp_TESTVAR(PL_defgv);
ppp_TESTVAR(PL_diehook);
+#if defined(PL_phase) || defined(PL_Iphase)
+ ppp_PARSERVAR_dummy;
+#else
ppp_TESTVAR(PL_dirty);
+#endif
ppp_TESTVAR(PL_dowarn);
ppp_TESTVAR(PL_errgv);
ppp_TESTVAR(PL_laststatval);
diff --git a/embedvar.h b/embedvar.h
index ca316ef168..290d40262c 100644
--- a/embedvar.h
+++ b/embedvar.h
@@ -118,7 +118,6 @@
#define PL_delaymagic (vTHX->Idelaymagic)
#define PL_destroyhook (vTHX->Idestroyhook)
#define PL_diehook (vTHX->Idiehook)
-#define PL_dirty (vTHX->Idirty)
#define PL_doswitches (vTHX->Idoswitches)
#define PL_dowarn (vTHX->Idowarn)
#define PL_dumper_fd (vTHX->Idumper_fd)
@@ -449,7 +448,6 @@
#define PL_Idelaymagic PL_delaymagic
#define PL_Idestroyhook PL_destroyhook
#define PL_Idiehook PL_diehook
-#define PL_Idirty PL_dirty
#define PL_Idoswitches PL_doswitches
#define PL_Idowarn PL_dowarn
#define PL_Idumper_fd PL_dumper_fd
diff --git a/gv.c b/gv.c
index 691dbbab23..9f62066f74 100644
--- a/gv.c
+++ b/gv.c
@@ -2628,7 +2628,7 @@ Perl_gv_try_downgrade(pTHX_ GV *gv)
/* XXX Why and where does this leave dangling pointers during global
destruction? */
- if (PL_dirty) return;
+ if (PL_phase == PERL_PHASE_DESTRUCT) return;
if (!(SvREFCNT(gv) == 1 && SvTYPE(gv) == SVt_PVGV && !SvFAKE(gv) &&
!SvOBJECT(gv) && !SvREADONLY(gv) &&
diff --git a/hv.c b/hv.c
index b43523954a..615cec2742 100644
--- a/hv.c
+++ b/hv.c
@@ -1856,7 +1856,7 @@ Perl_hv_undef(pTHX_ HV *hv)
DEBUG_A(Perl_hv_assert(aTHX_ hv));
xhv = (XPVHV*)SvANY(hv);
- if ((name = HvENAME_get(hv)) && !PL_dirty)
+ if ((name = HvENAME_get(hv)) && PL_phase != PERL_PHASE_DESTRUCT)
{
/* Delete the @ISA element before calling mro_package_moved, so it
does not see it. */
diff --git a/intrpvar.h b/intrpvar.h
index 52e97119de..1ba3ab8000 100644
--- a/intrpvar.h
+++ b/intrpvar.h
@@ -248,8 +248,6 @@ PERLVAR(Iregmatch_state, regmatch_state *)
PERLVAR(Idelaymagic, U16) /* ($<,$>) = ... */
PERLVAR(Ilocalizing, U8) /* are we processing a local() list? */
PERLVAR(Icolorset, bool) /* from regcomp.c */
-PERLVARI(Idirty, bool, FALSE) /* in the middle of tearing things
- down? */
PERLVAR(Iin_eval, U8) /* trap "fatal" errors? */
PERLVAR(Itainted, bool) /* using variables controlled by $< */
diff --git a/mg.c b/mg.c
index 01240a7449..4a342d4d81 100644
--- a/mg.c
+++ b/mg.c
@@ -1617,7 +1617,7 @@ Perl_magic_clearisa(pTHX_ SV *sv, MAGIC *mg)
PERL_ARGS_ASSERT_MAGIC_CLEARISA;
/* Bail out if destruction is going on */
- if(PL_dirty) return 0;
+ if(PL_phase == PERL_PHASE_DESTRUCT) return 0;
if (sv)
av_clear(MUTABLE_AV(sv));
diff --git a/pad.c b/pad.c
index d395e71dfe..1fcd375152 100644
--- a/pad.c
+++ b/pad.c
@@ -277,7 +277,7 @@ Perl_pad_undef(pTHX_ CV* cv)
/* XXX DAPM for efficiency, we should only do this if we know we have
* children, or integrate this loop with general cleanup */
- if (!PL_dirty) { /* don't bother during global destruction */
+ if (PL_phase != PERL_PHASE_DESTRUCT) { /* don't bother during global destruction */
CV * const outercv = CvOUTSIDE(cv);
const U32 seq = CvOUTSIDE_SEQ(cv);
AV * const comppad_name = MUTABLE_AV(AvARRAY(padlist)[0]);
diff --git a/perl.c b/perl.c
index 8ed0960eac..438106e023 100644
--- a/perl.c
+++ b/perl.c
@@ -754,7 +754,6 @@ perl_destruct(pTHXx)
SvREFCNT_dec(PL_main_cv);
PL_main_cv = NULL;
PL_phase = PERL_PHASE_DESTRUCT;
- PL_dirty = TRUE;
/* Tell PerlIO we are about to tear things apart in case
we have layers which are using resources that should
diff --git a/perl.h b/perl.h
index fc7cf078a0..22bb6d8e36 100644
--- a/perl.h
+++ b/perl.h
@@ -4738,6 +4738,13 @@ EXTCONST char *const PL_phase_names[] = {
EXTCONST char *const PL_phase_names[];
#endif
+#ifndef PERL_CORE
+/* Do not use this macro. It only exists for extensions that rely on PL_dirty
+ * instead of using the newer PL_phase, which provides everything PL_dirty
+ * provided, and more. */
+# define PL_dirty (PL_phase == PERL_PHASE_DESTRUCT)
+#endif /* !PERL_CORE */
+
END_EXTERN_C
/*****************************************************************************/
diff --git a/sv.c b/sv.c
index 484b4021ef..f787b84de9 100644
--- a/sv.c
+++ b/sv.c
@@ -13123,7 +13123,6 @@ perl_clone_using(PerlInterpreter *proto_perl, UV flags,
PL_restartop = proto_perl->Irestartop;
PL_in_eval = proto_perl->Iin_eval;
PL_delaymagic = proto_perl->Idelaymagic;
- PL_dirty = proto_perl->Idirty;
PL_phase = proto_perl->Iphase;
PL_localizing = proto_perl->Ilocalizing;
diff --git a/util.c b/util.c
index f0b472a59c..a878f4b638 100644
--- a/util.c
+++ b/util.c
@@ -1116,7 +1116,7 @@ S_mess_alloc(pTHX)
SV *sv;
XPVMG *any;
- if (!PL_dirty)
+ if (PL_phase != PERL_PHASE_DESTRUCT)
return newSVpvs_flags("", SVs_TEMP);
if (PL_mess_sv)
@@ -1343,7 +1343,7 @@ Perl_mess_sv(pTHX_ SV *basemsg, bool consume)
line_mode ? "line" : "chunk",
(IV)IoLINES(GvIOp(PL_last_in_gv)));
}
- if (PL_dirty)
+ if (PL_phase == PERL_PHASE_DESTRUCT)
sv_catpvs(sv, " during global destruction");
sv_catpvs(sv, ".\n");
}