Stop PL_comppad pointing to a freed pad during global destruction
Dave Mitchell [Sun, 11 Apr 2004 14:27:26 +0000 (14:27 +0000)]
p4raw-id: //depot/perl@22688

sv.c

diff --git a/sv.c b/sv.c
index b776f56..36fbc21 100644 (file)
--- a/sv.c
+++ b/sv.c
@@ -448,6 +448,10 @@ do_clean_all(pTHX_ SV *sv)
 {
     DEBUG_D((PerlIO_printf(Perl_debug_log, "Cleaning loops: SV at 0x%"UVxf"\n", PTR2UV(sv)) ));
     SvFLAGS(sv) |= SVf_BREAK;
+    if (PL_comppad == (AV*)sv) {
+       PL_comppad = Nullav;
+       PL_curpad = Null(SV**);
+    }
     SvREFCNT_dec(sv);
 }