In perl.git, the branch blead has been updated

<http://perl5.git.perl.org/perl.git/commitdiff/92c843fb4b4e1a1e0ac7ec0fe198dc77266838da?hp=ac15b3d6d72ab4715b650413eb5ab8ed5c6dc1a4>

- Log -----------------------------------------------------------------
commit 92c843fb4b4e1a1e0ac7ec0fe198dc77266838da
Author: Tony Cook <[email protected]>
Date:   Mon Sep 5 15:40:11 2016 +1000

    (perl #129130) make chdir allocate the stack it needs
    
    chdir with no argument didn't ensure there was stack space available
    for its result.
-----------------------------------------------------------------------

Summary of changes:
 pp_sys.c     | 1 +
 t/op/chdir.t | 8 +++++++-
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/pp_sys.c b/pp_sys.c
index 13f2913..10d6185 100644
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -3635,6 +3635,7 @@ PP(pp_chdir)
        HV * const table = GvHVn(PL_envgv);
        SV **svp;
 
+        EXTEND(SP, 1);
         if (    (svp = hv_fetchs(table, "HOME", FALSE))
              || (svp = hv_fetchs(table, "LOGDIR", FALSE))
 #ifdef VMS
diff --git a/t/op/chdir.t b/t/op/chdir.t
index 9967707..38cbbe9 100644
--- a/t/op/chdir.t
+++ b/t/op/chdir.t
@@ -12,7 +12,7 @@ BEGIN {
     set_up_inc(qw(t . lib ../lib));
 }
 
-plan(tests => 47);
+plan(tests => 48);
 
 use Config;
 use Errno qw(ENOENT EBADF EINVAL);
@@ -162,6 +162,12 @@ sub check_env {
     }
 }
 
+fresh_perl_is(<<'EOP', '', { stderr => 1 }, "check stack handling");
+for $x (map $_+1, 1 .. 100) {
+  map chdir, 1 .. $x;
+}
+EOP
+
 my %Saved_Env = ();
 sub clean_env {
     foreach my $env (@magic_envs) {

--
Perl5 Master Repository

Reply via email to