summaryrefslogtreecommitdiff
path: root/pcre_study.c
diff options
context:
space:
mode:
authorph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15>2011-09-09 10:34:57 +0000
committerph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15>2011-09-09 10:34:57 +0000
commit2b89a6e5545b5e03927262b30350854493aec272 (patch)
tree3a2658f8608ee3acca08a32a987490e03fa4f5c1 /pcre_study.c
parent41d771a6026f926ffa918476af5c451ee9cc0c35 (diff)
downloadpcre-2b89a6e5545b5e03927262b30350854493aec272.tar.gz
Patch to RunTest for use with simulations; further JIT code/test tidies.
git-svn-id: svn://vcs.exim.org/pcre/code/trunk@689 2f5784b3-3f2a-0410-8824-cb99058d5e15
Diffstat (limited to 'pcre_study.c')
-rw-r--r--pcre_study.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/pcre_study.c b/pcre_study.c
index 8670090..c7dd59b 100644
--- a/pcre_study.c
+++ b/pcre_study.c
@@ -1332,22 +1332,23 @@ if (bits_set || min > 0
study->flags |= PCRE_STUDY_MAPPED;
memcpy(study->start_bits, start_bits, sizeof(start_bits));
}
-
- if (min > 0)
- {
- study->flags |= PCRE_STUDY_MINLEN;
- study->minlength = min;
- }
+
+ /* Always set the minlength value in the block, because the JIT compiler
+ makes use of it. However, don't set the bit unless the length is greater than
+ zero - the interpretive pcre_exec() and pcre_dfa_exec() needn't waste time
+ checking this case. */
+
+ study->minlength = min;
+ if (min > 0) study->flags |= PCRE_STUDY_MINLEN;
/* If JIT support was compiled and requested, attempt the JIT compilation.
If no starting bytes were found, and the minimum length is zero, and JIT
- compilation fails, no flags will be set, so abandon the extra block and
- return NULL. */
+ compilation fails, abandon the extra block and return NULL. */
#ifdef SUPPORT_JIT
extra->executable_jit = NULL;
if ((options & PCRE_STUDY_JIT_COMPILE) != 0) _pcre_jit_compile(re, extra);
- if (study->flags == 0)
+ if (study->flags == 0 && (extra->flags & PCRE_EXTRA_EXECUTABLE_JIT) == 0)
{
pcre_free_study(extra);
extra = NULL;