In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/726368e016b611dfdf44e3a9a53e572b2e25de73?hp=19949523b593c5b1e189da235f8065e235ee68e0>
- Log ----------------------------------------------------------------- commit 726368e016b611dfdf44e3a9a53e572b2e25de73 Author: David Mitchell <[email protected]> Date: Tue Apr 5 09:26:21 2016 +0100 ss_dup: make new savestack have SS_MAXPUSH extra This fixes RT #perl #127799 My commit v5.23.7-261-g3caf026 made PL_savestack_max claim to have allocated less than had actually been claimed (by a margin of SS_MAXPUSH). This made the 'check whether the stack needs extending code' slightly simpler, and errs on the side of safety. Except: Perl_ss_dup(), when duplicating the savestack, makes the new stack PL_savestack_max in size, which is large enough to duplicate the existing stack, but the new stack no longer has a SS_MAXPUSH margin at the top. The dSS_ADD family of macros work by assuming there is always such a margin: they push their args onto the stack and only then check whether the stack needs growing. This makes the code much more efficient, but of course breaks if no margin is present. ----------------------------------------------------------------------- Summary of changes: sv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sv.c b/sv.c index 819a250..0200679 100644 --- a/sv.c +++ b/sv.c @@ -14182,7 +14182,7 @@ Perl_ss_dup(pTHX_ PerlInterpreter *proto_perl, CLONE_PARAMS* param) { dVAR; ANY * const ss = proto_perl->Isavestack; - const I32 max = proto_perl->Isavestack_max; + const I32 max = proto_perl->Isavestack_max + SS_MAXPUSH; I32 ix = proto_perl->Isavestack_ix; ANY *nss; const SV *sv; -- Perl5 Master Repository
