From: Jan Dubois Date: Wed, 2 Dec 2009 09:34:18 +0000 (-0800) Subject: Cleanup all scopes before exiting a pseudo-forked process. X-Git-Tag: v5.11.3~131 X-Git-Url: https://perl5.git.perl.org/perl5.git/commitdiff_plain/adab9969?hp=781ecc3f4e65a5261736cf5fa8e56b6bea2ff71a Cleanup all scopes before exiting a pseudo-forked process. perl_destruct() contains an assertion that the scope stack is empty. The remaining scopes are due to fork() being called from within a BEGIN block. --- diff --git a/win32/perlhost.h b/win32/perlhost.h index 61f8765..5e89f85 100644 --- a/win32/perlhost.h +++ b/win32/perlhost.h @@ -1769,6 +1769,11 @@ restart: switch (status) { case 0: CALLRUNOPS(aTHX); + /* We may have additional unclosed scopes if fork() was called + * from within a BEGIN block. See perlfork.pod for more details. + */ + while (PL_scopestack_ix > oldscope) + LEAVE; status = 0; break; case 2: