From: Nicholas Clark Date: Fri, 8 Dec 2006 23:49:51 +0000 (+0000) Subject: In Perl_fbm_instr(), no need to calculate the address of the table if X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=3566a07d0a1971a157d7d35ea17ca7d26f785868;p=p5sagit%2Fp5-mst-13.2.git In Perl_fbm_instr(), no need to calculate the address of the table if we're going to return anyway. p4raw-id: //depot/perl@29492 --- diff --git a/util.c b/util.c index eefb5a5..358af39 100644 --- a/util.c +++ b/util.c @@ -680,12 +680,14 @@ Perl_fbm_instr(pTHX_ unsigned char *big, register unsigned char *bigend, SV *lit return b; } - { /* Do actual FBM. */ + /* Do actual FBM. */ + if (littlelen > (STRLEN)(bigend - big)) + return NULL; + + { register const unsigned char * const table = little + littlelen + FBM_TABLE_OFFSET; register const unsigned char *oldlittle; - if (littlelen > (STRLEN)(bigend - big)) - return NULL; --littlelen; /* Last char found by table lookup */ s = big + littlelen;