From: Nicholas Clark Date: Mon, 11 Dec 2006 21:21:09 +0000 (+0000) Subject: Convert the -1 to a more explicit PERL_FBM_FLAGS_OFFSET_FROM_TABLE. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=c8029a41836bfd27a0636d6911767d88af046f75;p=p5sagit%2Fp5-mst-13.2.git Convert the -1 to a more explicit PERL_FBM_FLAGS_OFFSET_FROM_TABLE. p4raw-id: //depot/perl@29522 --- diff --git a/util.c b/util.c index 8ce13e9..1ce8128 100644 --- a/util.c +++ b/util.c @@ -455,6 +455,7 @@ Perl_rninstr(pTHX_ register const char *big, const char *bigend, const char *lit } #define PERL_FBM_TABLE_OFFSET 2 /* Number of bytes between EOS and table*/ +#define PERL_FBM_FLAGS_OFFSET_FROM_TABLE -1 /* As a space optimization, we do not compile tables for strings of length 0 and 1, and for strings of length 2 unless FBMcf_TAIL. These are @@ -504,7 +505,7 @@ Perl_fbm_compile(pTHX_ SV *sv, U32 flags) = (unsigned char*)(SvPVX_mutable(sv) + len + PERL_FBM_TABLE_OFFSET); s = table - 1 - PERL_FBM_TABLE_OFFSET; /* last char */ memset((void*)table, mlen, 256); - table[-1] = (U8)flags; + table[PERL_FBM_FLAGS_OFFSET_FROM_TABLE] = (U8)flags; i = 0; sb = s - mlen + 1; /* first char (maybe) */ while (s >= sb) { @@ -723,7 +724,8 @@ Perl_fbm_instr(pTHX_ unsigned char *big, register unsigned char *bigend, SV *lit } } check_end: - if ( s == bigend && (table[-1] & FBMcf_TAIL) + if ( s == bigend + && (table[PERL_FBM_FLAGS_OFFSET_FROM_TABLE] & FBMcf_TAIL) && memEQ((char *)(bigend - littlelen), (char *)(oldlittle - littlelen), littlelen) ) return (char*)bigend - littlelen;