In perl.git, the branch blead has been updated

<http://perl5.git.perl.org/perl.git/commitdiff/49f9fecb5d7481850ac2474c72c1013a4c763226?hp=77b030b5bd8a1500c27a6b5c5d30903c83a4c704>

- Log -----------------------------------------------------------------
commit 49f9fecb5d7481850ac2474c72c1013a4c763226
Author: Vincent Pit <[email protected]>
Date:   Sat Sep 27 19:00:46 2014 +0200

    Properly set the phase for END blocks run at the end of a pseudo-fork
-----------------------------------------------------------------------

Summary of changes:
 t/op/fork.t      | 10 ++++++++++
 win32/perlhost.h |  4 +++-
 2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/t/op/fork.t b/t/op/fork.t
index 60c991b..734e223 100644
--- a/t/op/fork.t
+++ b/t/op/fork.t
@@ -519,3 +519,13 @@ sub main {
 }
 EXPECT
 foo
+########
+# ${^GLOBAL_PHASE} at the end of a pseudo-fork
+if (my $pid = fork) {
+    waitpid $pid, 0;
+} else {
+    eval 'END { print "${^GLOBAL_PHASE}\n" }';
+    exit;
+}
+EXPECT
+END
diff --git a/win32/perlhost.h b/win32/perlhost.h
index 265328b..b1c6c80 100644
--- a/win32/perlhost.h
+++ b/win32/perlhost.h
@@ -1759,8 +1759,10 @@ restart:
                SvREFCNT_dec(PL_curstash);
                PL_curstash = (HV *)SvREFCNT_inc(PL_defstash);
            }
-           if (PL_endav && !PL_minus_c)
+           if (PL_endav && !PL_minus_c) {
+               PERL_SET_PHASE(PERL_PHASE_END);
                call_list(oldscope, PL_endav);
+           }
            status = STATUS_EXIT;
            break;
        case 3:

--
Perl5 Master Repository

Reply via email to