summaryrefslogtreecommitdiff
path: root/regcomp.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2009-07-17 16:17:58 +0100
committerNicholas Clark <nick@ccl4.org>2009-07-17 17:39:46 +0100
commitb6f609162799aa49813b53c8242464db37fcee9b (patch)
treeff78dab5934ab802fe26af0ee59e0fe5b859dc76 /regcomp.c
parentc533d96e5f6c9e94d3d34f6ff54accc877705220 (diff)
downloadperl-b6f609162799aa49813b53c8242464db37fcee9b.tar.gz
Eliminate struct regexp_allocated and xpvio_allocated.
Calculate memory allocation using regexp and XPVIO, and the offset of the first real structure member. This avoids tripping over alignment differences between X* and x*_allocated, because x*_allocated doesn't have a double in it.
Diffstat (limited to 'regcomp.c')
-rw-r--r--regcomp.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/regcomp.c b/regcomp.c
index 50b0632529..22c02c82ad 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -9452,7 +9452,8 @@ Perl_reg_temp_copy (pTHX_ REGEXP *rx)
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->xpv_cur), &(ret->xpv_cur), struct regexp_allocated);
+ memcpy(&(ret->xpv_cur), &(r->xpv_cur),
+ sizeof(regexp) - STRUCT_OFFSET(regexp, xpv_cur));
SvLEN_set(ret_x, 0);
Newx(ret->offs, npar, regexp_paren_pair);
Copy(r->offs, ret->offs, npar, regexp_paren_pair);