summaryrefslogtreecommitdiff
path: root/regcomp.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2008-01-05 21:33:30 +0000
committerNicholas Clark <nick@ccl4.org>2008-01-05 21:33:30 +0000
commit08e447406761619260203dbbef9cf10b6efa533c (patch)
tree0ecbcc7b50cf5cb76a4982389bdb6962475f8be0 /regcomp.c
parentd0a30c4343e6b989663db0abe44ac1e4c2820428 (diff)
downloadperl-08e447406761619260203dbbef9cf10b6efa533c.tar.gz
Don't allocate the NV slot for SVt_REGEXP.
p4raw-id: //depot/perl@32859
Diffstat (limited to 'regcomp.c')
-rw-r--r--regcomp.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/regcomp.c b/regcomp.c
index 96dd3f967e..48a6944fcc 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -9206,14 +9206,13 @@ Perl_reg_temp_copy (pTHX_ REGEXP *rx) {
struct regexp *const r = (struct regexp *)SvANY(rx);
register const I32 npar = r->nparens+1;
(void)ReREFCNT_inc(rx);
- /* FIXME ORANGE (once we start actually using the regular SV fields.) */
/* We can take advantage of the existing "copied buffer" mechanism in SVs
by pointing directly at the buffer, but flagging that the allocated
space in the copy is zero. As we've just done a struct copy, it's now
a case of zero-ing that, rather than copying the current length. */
SvPV_set(ret_x, RX_WRAPPED(rx));
SvFLAGS(ret_x) |= SvFLAGS(rx) & (SVf_POK|SVp_POK|SVf_UTF8);
- StructCopy(r, ret, regexp);
+ StructCopy(&(r->xpv_cur), &(ret->xpv_cur), struct regexp_allocated);
SvLEN_set(ret_x, 0);
Newx(ret->offs, npar, regexp_paren_pair);
Copy(r->offs, ret->offs, npar, regexp_paren_pair);