diff options
author | Nicholas Clark <nick@ccl4.org> | 2008-10-05 21:51:54 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2008-10-05 21:51:54 +0000 |
commit | 45cf45700e1f870b69e32588ff8b7583510f7b6b (patch) | |
tree | 454a7b02cdbad7c23df3266bbdb97aae359a009c /regcomp.c | |
parent | 9be01f29fa8229b0cb279cd26191f322dbf0ae2a (diff) | |
download | perl-45cf45700e1f870b69e32588ff8b7583510f7b6b.tar.gz |
Avoid allocating 1 extra regnode when duplicating a regexp.
See http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2008-09/msg00590.html
and http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2008-10/msg00163.html
p4raw-id: //depot/perl@34464
Diffstat (limited to 'regcomp.c')
-rw-r--r-- | regcomp.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -9625,7 +9625,7 @@ Perl_regdupe_internal(pTHX_ REGEXP * const rx, CLONE_PARAMS *param) npar = r->nparens+1; len = ProgLen(ri); - Newxc(reti, sizeof(regexp_internal) + (len+1)*sizeof(regnode), char, regexp_internal); + Newxc(reti, sizeof(regexp_internal) + len*sizeof(regnode), char, regexp_internal); Copy(ri->program, reti->program, len+1, regnode); |