summaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2006-12-08 23:49:51 +0000
committerNicholas Clark <nick@ccl4.org>2006-12-08 23:49:51 +0000
commit3566a07d0a1971a157d7d35ea17ca7d26f785868 (patch)
treea52942e6b95a463f0f64b322c454ec4e8255a063 /util.c
parent85efc3a51ca0ee5724a80b554624140f51d5305c (diff)
downloadperl-3566a07d0a1971a157d7d35ea17ca7d26f785868.tar.gz
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
Diffstat (limited to 'util.c')
-rw-r--r--util.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/util.c b/util.c
index eefb5a5e87..358af393a3 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;