summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--win32/perlhost.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/win32/perlhost.h b/win32/perlhost.h
index 61f87659df..5e89f854f8 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: