summaryrefslogtreecommitdiff
path: root/regexec.c
diff options
context:
space:
mode:
Diffstat (limited to 'regexec.c')
-rw-r--r--regexec.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/regexec.c b/regexec.c
index 3d64f20ea5..e57a336287 100644
--- a/regexec.c
+++ b/regexec.c
@@ -1663,8 +1663,8 @@ S_swap_match_buff (pTHX_ regexp *prog) {
*/
Newxz(prog->swap, 1, regexp_paren_ofs);
/* no need to copy these */
- Newxz(prog->swap->startp, prog->nparens + 1, I32);
- Newxz(prog->swap->endp, prog->nparens + 1, I32);
+ Newxz(prog->swap->startp, 2 * (prog->nparens + 1), I32);
+ prog->swap->endp = prog->swap->startp + prog->nparens + 1;
}
t = prog->swap->startp;
prog->swap->startp = prog->startp;