[Pcre-svn] [676] code/trunk: Give PCRE_ERROR_JIT_STACKLIMIT …

トップ ページ
このメッセージを削除
著者: Subversion repository
日付:  
To: pcre-svn
題目: [Pcre-svn] [676] code/trunk: Give PCRE_ERROR_JIT_STACKLIMIT when JIT runs out of stack .
Revision: 676
          http://vcs.pcre.org/viewvc?view=rev&revision=676
Author:   ph10
Date:     2011-08-27 16:53:04 +0100 (Sat, 27 Aug 2011)


Log Message:
-----------
Give PCRE_ERROR_JIT_STACKLIMIT when JIT runs out of stack.

Modified Paths:
--------------
    code/trunk/pcre.h.in
    code/trunk/pcre_jit_compile.c
    code/trunk/pcretest.c


Modified: code/trunk/pcre.h.in
===================================================================
--- code/trunk/pcre.h.in    2011-08-27 10:18:46 UTC (rev 675)
+++ code/trunk/pcre.h.in    2011-08-27 15:53:04 UTC (rev 676)
@@ -164,6 +164,7 @@
 #define PCRE_ERROR_BADOFFSET      (-24)
 #define PCRE_ERROR_SHORTUTF8      (-25)
 #define PCRE_ERROR_RECURSELOOP    (-26)
+#define PCRE_ERROR_JIT_STACKLIMIT (-27)


/* Specific error codes for UTF-8 validity checks */


Modified: code/trunk/pcre_jit_compile.c
===================================================================
--- code/trunk/pcre_jit_compile.c    2011-08-27 10:18:46 UTC (rev 675)
+++ code/trunk/pcre_jit_compile.c    2011-08-27 15:53:04 UTC (rev 676)
@@ -6145,7 +6145,7 @@
   common->currententry = common->currententry->next;
   }


-/* Allocating stack, returns with PCRE_ERROR_NOMEMORY if fails. */
+/* Allocating stack, returns with PCRE_ERROR_JIT_STACKLIMIT if fails. */
/* This is a (really) rare case. */
set_jumps(common->stackalloc, LABEL());
/* RETURN_ADDR is not a saved register. */
@@ -6168,7 +6168,7 @@
/* Allocation failed. */
JUMPHERE(alloc_error);
/* We break the return address cache here, but this is a really rare case. */
-OP1(SLJIT_MOV, MAX_INDEX, 0, SLJIT_IMM, PCRE_ERROR_NOMEMORY);
+OP1(SLJIT_MOV, MAX_INDEX, 0, SLJIT_IMM, PCRE_ERROR_JIT_STACKLIMIT);
JUMPTO(SLJIT_JUMP, leave);

if (common->revertframes != NULL)

Modified: code/trunk/pcretest.c
===================================================================
--- code/trunk/pcretest.c    2011-08-27 10:18:46 UTC (rev 675)
+++ code/trunk/pcretest.c    2011-08-27 15:53:04 UTC (rev 676)
@@ -229,7 +229,8 @@
   "invalid combination of newline options",
   "bad offset value",
   NULL,  /* SHORTUTF8 is handled specially */
-  "nested recursion at the same subject position"
+  "nested recursion at the same subject position",
+  "JIT stack limit reached" 
 };