This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
offset PL_savestack_max by SS_MAXPUSH
authorDavid Mitchell <davem@iabyn.com>
Sun, 27 Dec 2015 14:07:02 +0000 (14:07 +0000)
committerDavid Mitchell <davem@iabyn.com>
Wed, 3 Feb 2016 09:19:19 +0000 (09:19 +0000)
commit3caf0269dd4c609b8c2bc22b54598c642ba63ed8
tree15088650105af3273d292e3d54a5ba33b1f91ae3
parent2ef9a108812a6ae3c346882b7338742e392deb89
offset PL_savestack_max by SS_MAXPUSH

The newer SS_ADD macros expect there to always be SS_MAXPUSH slots
free on the savestack; so they can push multiple items, then only check
once at the end whether stack needs expanding.

This commit makes savestack_grow() set PL_savestack_max to SS_MAXPUSH
short of what has actually been allocated. This makes the tests
to see whether the stack needs growing slightly simpler, i.e.

    PL_savestack_ix > PL_savestack_max

rather than

    PL_savestack_ix + SS_MAXPUSH > PL_savestack_max
perl.c
scope.c
scope.h