diff options
author | Nicholas Clark <nick@ccl4.org> | 2009-07-17 16:17:58 +0100 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2009-07-17 17:39:46 +0100 |
commit | b6f609162799aa49813b53c8242464db37fcee9b (patch) | |
tree | ff78dab5934ab802fe26af0ee59e0fe5b859dc76 /regcomp.c | |
parent | c533d96e5f6c9e94d3d34f6ff54accc877705220 (diff) | |
download | perl-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.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -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); |