diff options
author | zherczeg <zherczeg@2f5784b3-3f2a-0410-8824-cb99058d5e15> | 2015-04-01 13:43:02 +0000 |
---|---|---|
committer | zherczeg <zherczeg@2f5784b3-3f2a-0410-8824-cb99058d5e15> | 2015-04-01 13:43:02 +0000 |
commit | 14ce0b0c24bfb4dff4bcb602057014a487a19eef (patch) | |
tree | 5959b1edcda4e72bae9c0bdd43a0fc494313047d | |
parent | 6ad109ad6c477ea3f0816dac273d0e5ef8253993 (diff) | |
download | pcre-14ce0b0c24bfb4dff4bcb602057014a487a19eef.tar.gz |
Minor refactor in JIT and set auto-possessify limit to 1000 from 10000 (to match the Changelog).
git-svn-id: svn://vcs.exim.org/pcre/code/trunk@1541 2f5784b3-3f2a-0410-8824-cb99058d5e15
-rw-r--r-- | pcre_compile.c | 4 | ||||
-rw-r--r-- | pcre_jit_compile.c | 15 |
2 files changed, 5 insertions, 14 deletions
diff --git a/pcre_compile.c b/pcre_compile.c index b742805..ce65777 100644 --- a/pcre_compile.c +++ b/pcre_compile.c @@ -3658,7 +3658,7 @@ for (;;) get_chr_property_list(code, utf, cd->fcc, list) : NULL; list[1] = c == OP_STAR || c == OP_PLUS || c == OP_QUERY || c == OP_UPTO; - rec_limit = 10000; + rec_limit = 1000; if (end != NULL && compare_opcodes(end, utf, cd, list, end, &rec_limit)) { switch(c) @@ -3715,7 +3715,7 @@ for (;;) list[1] = (c & 1) == 0; - rec_limit = 10000; + rec_limit = 1000; if (compare_opcodes(end, utf, cd, list, end, &rec_limit)) { switch (c) diff --git a/pcre_jit_compile.c b/pcre_jit_compile.c index 538cee5..dd378e0 100644 --- a/pcre_jit_compile.c +++ b/pcre_jit_compile.c @@ -7255,12 +7255,14 @@ if (opcode == OP_COND || opcode == OP_SCOND) add_jump(compiler, &(BACKTRACK_AS(bracket_backtrack)->u.condfailed), JUMP(SLJIT_ZERO)); matchingpath += 1 + 2 * IMM2_SIZE; } - else if (*matchingpath == OP_RREF || *matchingpath == OP_DNRREF) + else if (*matchingpath == OP_RREF || *matchingpath == OP_DNRREF || *matchingpath == OP_FAIL) { /* Never has other case. */ BACKTRACK_AS(bracket_backtrack)->u.condfailed = NULL; SLJIT_ASSERT(!has_alternatives); + if (*matchingpath == OP_FAIL) + stacksize = 0; if (*matchingpath == OP_RREF) { stacksize = GET2(matchingpath, 1); @@ -7310,17 +7312,6 @@ if (opcode == OP_COND || opcode == OP_SCOND) matchingpath = cc; } } - else if (*matchingpath == OP_FAIL) - { - SLJIT_ASSERT(!has_alternatives); - if (*cc == OP_ALT) - { - matchingpath = cc + 1 + LINK_SIZE; - cc += GET(cc, 1); - } - else - matchingpath = cc; - } else { SLJIT_ASSERT(has_alternatives && *matchingpath >= OP_ASSERT && *matchingpath <= OP_ASSERTBACK_NOT); |