summaryrefslogtreecommitdiff
path: root/pp_ctl.c
diff options
context:
space:
mode:
authorYves Orton <demerphq@gmail.com>2023-03-18 10:57:34 +0100
committerYves Orton <demerphq@gmail.com>2023-03-19 05:27:01 +0800
commit1ed8aa9fdf7c8713cc895a86e3f9f22f89dfd200 (patch)
tree8d30a7fb3af0a0a75b19c1fc23855908057b612a /pp_ctl.c
parent7e782439cfcb8fc251201ee657e2e330ba944500 (diff)
downloadperl-1ed8aa9fdf7c8713cc895a86e3f9f22f89dfd200.tar.gz
pp_ctl.c - don't overallocate paren buffers in rxres_save().
This was added as part of a different fix and was not properly reverted when that fix was put on hold. This should only be applied if we do adopt the patch which adds "start_new" and "end_new" to the regexp_paren_pair structure.
Diffstat (limited to 'pp_ctl.c')
-rw-r--r--pp_ctl.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/pp_ctl.c b/pp_ctl.c
index 8b4081d3cf..d3cd6059df 100644
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -379,11 +379,12 @@ Perl_rxres_save(pTHX_ void **rsp, REGEXP *rx)
PERL_ARGS_ASSERT_RXRES_SAVE;
PERL_UNUSED_CONTEXT;
+ /* deal with regexp_paren_pair items */
if (!p || p[1] < RX_NPARENS(rx)) {
#ifdef PERL_ANY_COW
- i = 7 + (RX_NPARENS(rx)+1) * 4;
+ i = 7 + (RX_NPARENS(rx)+1) * 2;
#else
- i = 6 + (RX_NPARENS(rx)+1) * 4;
+ i = 6 + (RX_NPARENS(rx)+1) * 2;
#endif
if (!p)
Newx(p, i, UV);