From: Nicholas Clark Date: Mon, 11 Dec 2006 22:52:46 +0000 (+0000) Subject: Add BmPREVIOUS_set(), and use it in the one place that BmPREVIOUS is X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=39efed7fb68a394db844e6c312aadb72695b0ad8;p=p5sagit%2Fp5-mst-13.2.git Add BmPREVIOUS_set(), and use it in the one place that BmPREVIOUS is modified. p4raw-id: //depot/perl@29525 --- diff --git a/sv.h b/sv.h index 8c98c89..a80a0ac 100644 --- a/sv.h +++ b/sv.h @@ -1347,6 +1347,9 @@ the scalar's value cannot change unless written to. # define BmUSEFUL(sv) ((XPVBM*) SvANY(sv))->xiv_u.xivu_i32 # define BmPREVIOUS(sv) ((XPVBM*) SvANY(sv))->xbm_previous #endif +#define BmPREVIOUS_set(sv, val) \ + STMT_START { assert(SvTYPE(sv) == SVt_PVBM); \ + (((XPVBM*)SvANY(sv))->xbm_previous = (U16)(val)); } STMT_END #define FmLINES(sv) ((XPVFM*) SvANY(sv))->xfm_lines diff --git a/util.c b/util.c index daf88da..1ae9459 100644 --- a/util.c +++ b/util.c @@ -522,7 +522,7 @@ Perl_fbm_compile(pTHX_ SV *sv, U32 flags) } } BmRARE(sv) = s[rarest]; - BmPREVIOUS(sv) = (U16)rarest; + BmPREVIOUS_set(sv, rarest); BmUSEFUL(sv) = 100; /* Initial value */ if (flags & FBMcf_TAIL) SvTAIL_on(sv);