diff options
author | Yves Orton <demerphq@gmail.com> | 2023-02-19 17:03:47 +0100 |
---|---|---|
committer | Yves Orton <demerphq@gmail.com> | 2023-02-20 16:17:07 +0800 |
commit | fc11df3e7c474d125032d885d145d03146621204 (patch) | |
tree | 7171645909339468edd8311749918f6b08facb07 /t/re | |
parent | bbf836262130e1ab1030c03e3b3b390c28c4bbda (diff) | |
download | perl-fc11df3e7c474d125032d885d145d03146621204.tar.gz |
scope.c - rework SSGROW() and SSCHECK() macros and undelying functions
Prior to this patch SSCHECK() took a "needs" parameter, but did not
actually guarantee that the stack would be sufficiently large to
accomodate that many elements after the call. This was quite misleading.
Especially as SSGROW() would not do geometric preallocation, but
SSCHECK() would, so much of the time SSCHECK() would appear to be a
better choice, but not always.
This patch makes it so SSCHECK() is an alias for SSGROW(), and it makes
it so that SSGROW() also geometrically overallocates. The underlying
function that used to implement SSCHECK() savestack_grow() now calls the
savestack_grow_cnt() which has always implemented SSGROW(). Anything
in the internals that used to call SSCHECK() now calls SSGROW() instead.
At the same time the preallocation has been made a little bit more
aggressive, ensuring that we always allocate at least SS_MAXPUSH
elements on top of what was requested as part of the "known" size of the
stack, and additional SS_MAXPUSH elements which are not part of the
"known" size of the stack. This "hidden extra" is used to simply some of
the other macros which are used a lot internally. (I have beefed up the
comment explaining this as well.)
This fixes GH Issue #20826
Diffstat (limited to 't/re')
-rw-r--r-- | t/re/pat.t | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/t/re/pat.t b/t/re/pat.t index d950c30ec9..c494434675 100644 --- a/t/re/pat.t +++ b/t/re/pat.t @@ -2413,8 +2413,7 @@ SKIP: is($y,"b","Branch reset in list context check 11 (b)"); is($z,"z","Branch reset in list context check 12 (z)"); } - TODO:{ - local $::TODO = "Will be fixed next commit"; + { # Test for GH Issue #20826. Save stack overflow introduced in # 92373dea9d7bcc0a017f20cb37192c1d8400767f PR #20530. # Note this test depends on an assert so it will only fail |