This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Eliminate PL_dirty
[perl5.git] / pad.c
diff --git a/pad.c b/pad.c
index d395e71..1fcd375 100644 (file)
--- 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 */
 
     /* 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]);
        CV * const outercv = CvOUTSIDE(cv);
         const U32 seq = CvOUTSIDE_SEQ(cv);
        AV *  const comppad_name = MUTABLE_AV(AvARRAY(padlist)[0]);