[Pcre-svn] [1541] code/trunk: Minor refactor in JIT and set …

Top Page
Delete this message
Author: Subversion repository
Date:  
To: pcre-svn
Subject: [Pcre-svn] [1541] code/trunk: Minor refactor in JIT and set auto-possessify limit to 1000 from 10000 ( to match the Changelog).
Revision: 1541
          http://vcs.pcre.org/viewvc?view=rev&revision=1541
Author:   zherczeg
Date:     2015-04-01 14:43:02 +0100 (Wed, 01 Apr 2015)


Log Message:
-----------
Minor refactor in JIT and set auto-possessify limit to 1000 from 10000 (to match the Changelog).

Modified Paths:
--------------
    code/trunk/pcre_compile.c
    code/trunk/pcre_jit_compile.c


Modified: code/trunk/pcre_compile.c
===================================================================
--- code/trunk/pcre_compile.c    2015-03-29 17:41:16 UTC (rev 1540)
+++ code/trunk/pcre_compile.c    2015-04-01 13:43:02 UTC (rev 1541)
@@ -3658,7 +3658,7 @@
       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 @@


       list[1] = (c & 1) == 0;


-      rec_limit = 10000;
+      rec_limit = 1000;
       if (compare_opcodes(end, utf, cd, list, end, &rec_limit))
         {
         switch (c)


Modified: code/trunk/pcre_jit_compile.c
===================================================================
--- code/trunk/pcre_jit_compile.c    2015-03-29 17:41:16 UTC (rev 1540)
+++ code/trunk/pcre_jit_compile.c    2015-04-01 13:43:02 UTC (rev 1541)
@@ -7255,12 +7255,14 @@
     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 @@
           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);