summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzherczeg <zherczeg@2f5784b3-3f2a-0410-8824-cb99058d5e15>2014-01-13 21:25:53 +0000
committerzherczeg <zherczeg@2f5784b3-3f2a-0410-8824-cb99058d5e15>2014-01-13 21:25:53 +0000
commitd69cf0a5f2a3235a6b8a209a0d2b599a2f89150e (patch)
tree4688fe5e0d8bd347847cc48b74b57d3a0d631175
parente12305c1937338ee0e2c68c8b9f566b354257ed4 (diff)
downloadpcre-d69cf0a5f2a3235a6b8a209a0d2b599a2f89150e.tar.gz
JIT: Add not (^) and query (?) support to fast forward search.
git-svn-id: svn://vcs.exim.org/pcre/code/trunk@1448 2f5784b3-3f2a-0410-8824-cb99058d5e15
-rw-r--r--pcre_jit_compile.c37
1 files changed, 33 insertions, 4 deletions
diff --git a/pcre_jit_compile.c b/pcre_jit_compile.c
index 99d3af8..96eb728 100644
--- a/pcre_jit_compile.c
+++ b/pcre_jit_compile.c
@@ -3234,6 +3234,10 @@ while (TRUE)
cc = bracketend(cc);
continue;
+ case OP_PLUSI:
+ case OP_MINPLUSI:
+ case OP_POSPLUSI:
+ caseless = TRUE;
case OP_PLUS:
case OP_MINPLUS:
case OP_POSPLUS:
@@ -3248,11 +3252,22 @@ while (TRUE)
cc += 1 + IMM2_SIZE;
break;
- case OP_PLUSI:
- case OP_MINPLUSI:
- case OP_POSPLUSI:
+ case OP_QUERYI:
+ case OP_MINQUERYI:
+ case OP_POSQUERYI:
caseless = TRUE;
+ case OP_QUERY:
+ case OP_MINQUERY:
+ case OP_POSQUERY:
+ len = 1;
cc++;
+#ifdef SUPPORT_UTF
+ if (common->utf && HAS_EXTRALEN(*cc)) len += GET_EXTRALEN(*cc);
+#endif
+ max_chars = scan_prefix(common, cc + len, chars, bytes, max_chars);
+ if (max_chars == 0)
+ return consumed;
+ last = FALSE;
break;
case OP_KET:
@@ -3336,6 +3351,10 @@ while (TRUE)
cc++;
break;
+ case OP_NOT:
+ case OP_NOTI:
+ cc++;
+ /* Fall through. */
case OP_NOT_DIGIT:
case OP_NOT_WHITESPACE:
case OP_NOT_WORDCHAR:
@@ -3364,6 +3383,16 @@ while (TRUE)
cc += 1 + IMM2_SIZE;
continue;
+ case OP_NOTEXACT:
+ case OP_NOTEXACTI:
+#if defined SUPPORT_UTF && !defined COMPILE_PCRE32
+ if (common->utf) return consumed;
+#endif
+ any = TRUE;
+ repeat = GET2(cc, 1);
+ cc += 1 + IMM2_SIZE + 1;
+ break;
+
default:
return consumed;
}
@@ -3497,7 +3526,7 @@ int offsets[3];
pcre_uint32 mask;
pcre_uint8 *byte_set, *byte_set_end;
int i, max, from;
-int range_right = -1, range_len = 4 - 1;
+int range_right = -1, range_len = 3 - 1;
sljit_ub *update_table = NULL;
BOOL in_range;