This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Add assertions about there being no leftover scopes when enter perl_destruct.
authorGerard Goossen <gerard@ggoossen.net>
Mon, 2 Nov 2009 15:27:42 +0000 (16:27 +0100)
committerRafael Garcia-Suarez <rgs@consttype.org>
Sun, 8 Nov 2009 13:34:38 +0000 (14:34 +0100)
perl.c

diff --git a/perl.c b/perl.c
index e1c9ee1..dbb2081 100644 (file)
--- a/perl.c
+++ b/perl.c
@@ -540,6 +540,8 @@ perl_destruct(pTHXx)
     PERL_UNUSED_ARG(my_perl);
 #endif
 
+    assert(PL_scopestack_ix == 1);
+
     /* wait for all pseudo-forked children to finish */
     PERL_WAIT_FOR_CHILDREN;
 
@@ -567,6 +569,7 @@ perl_destruct(pTHXx)
     }
     LEAVE;
     FREETMPS;
+    assert(PL_scopestack_ix == 0);
 
     /* Need to flush since END blocks can produce output */
     my_fflush_all();