From 3d22c4f05aed968c6c562e40be30222328d66f6b Mon Sep 17 00:00:00 2001 From: Gerard Goossen Date: Mon, 2 Nov 2009 16:27:42 +0100 Subject: [PATCH] Add assertions about there being no leftover scopes when enter perl_destruct. --- perl.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/perl.c b/perl.c index e1c9ee1..dbb2081 100644 --- 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(); -- 2.7.4