From: Nicholas Clark Date: Sat, 5 Jan 2008 00:59:18 +0000 (+0000) Subject: Fix the compile for -DPERL_OLD_COPY_ON_WRITE (apart from the tenacious X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=bdd9a1b1ec56a0b6b7d8b1b363138a8fbd3040e3;p=p5sagit%2Fp5-mst-13.2.git Fix the compile for -DPERL_OLD_COPY_ON_WRITE (apart from the tenacious broken window: ../ext/Compress/Raw/Zlib/t/07bufsize.t) p4raw-id: //depot/perl@32837 --- diff --git a/pp_ctl.c b/pp_ctl.c index 36e02df..6353df6 100644 --- a/pp_ctl.c +++ b/pp_ctl.c @@ -330,8 +330,8 @@ Perl_rxres_save(pTHX_ void **rsp, REGEXP *rx) RX_MATCH_COPIED_off(rx); #ifdef PERL_OLD_COPY_ON_WRITE - *p++ = PTR2UV(rx->saved_copy); - rx->saved_copy = NULL; + *p++ = PTR2UV(RX_SAVED_COPY(rx)); + RX_SAVED_COPY(rx) = NULL; #endif *p++ = RX_NPARENS(rx); @@ -356,9 +356,9 @@ Perl_rxres_restore(pTHX_ void **rsp, REGEXP *rx) *p++ = 0; #ifdef PERL_OLD_COPY_ON_WRITE - if (rx->saved_copy) - SvREFCNT_dec (rx->saved_copy); - rx->saved_copy = INT2PTR(SV*,*p); + if (RX_SAVED_COPY(rx)) + SvREFCNT_dec (RX_SAVED_COPY(rx)); + RX_SAVED_COPY(rx) = INT2PTR(SV*,*p); *p++ = 0; #endif diff --git a/pp_hot.c b/pp_hot.c index e1d8621..5bc38be 100644 --- a/pp_hot.c +++ b/pp_hot.c @@ -1479,16 +1479,17 @@ yup: /* Confirmed by INTUIT */ (int) SvTYPE(TARG), (void*)truebase, (void*)t, (int)(t-truebase)); } - rx->saved_copy = sv_setsv_cow(rx->saved_copy, TARG); - RX_SUBBEG(rx) = (char *) SvPVX_const(rx->saved_copy) + (t - truebase); - assert (SvPOKp(rx->saved_copy)); + RX_SAVED_COPY(rx) = sv_setsv_cow(RX_SAVED_COPY(rx), TARG); + RX_SUBBEG(rx) + = (char *) SvPVX_const(RX_SAVED_COPY(rx)) + (t - truebase); + assert (SvPOKp(RX_SAVED_COPY(rx))); } else #endif { RX_SUBBEG(rx) = savepvn(t, strend - t); #ifdef PERL_OLD_COPY_ON_WRITE - rx->saved_copy = NULL; + RX_SAVED_COPY(rx) = NULL; #endif } RX_SUBLEN(rx) = strend - t; diff --git a/regexp.h b/regexp.h index 6fd42c6..1a2b17c 100644 --- a/regexp.h +++ b/regexp.h @@ -387,6 +387,7 @@ and check for NULL. #define RX_LASTPAREN(prog) (((struct regexp *)SvANY(prog))->lastparen) #define RX_LASTCLOSEPAREN(prog) (((struct regexp *)SvANY(prog))->lastcloseparen) #define RX_SEEN_EVALS(prog) (((struct regexp *)SvANY(prog))->seen_evals) +#define RX_SAVED_COPY(prog) (((struct regexp *)SvANY(prog))->saved_copy) #endif /* PLUGGABLE_RE_EXTENSION */ @@ -394,8 +395,8 @@ and check for NULL. #ifdef PERL_OLD_COPY_ON_WRITE #define RX_MATCH_COPY_FREE(rx) \ - STMT_START {if (rx->saved_copy) { \ - SV_CHECK_THINKFIRST_COW_DROP(rx->saved_copy); \ + STMT_START {if (RX_SAVED_COPY(rx)) { \ + SV_CHECK_THINKFIRST_COW_DROP(RX_SAVED_COPY(rx)); \ } \ if (RX_MATCH_COPIED(rx)) { \ Safefree(RX_SUBBEG(rx)); \