[Pcre-svn] [251] code/trunk/src/pcre2_jit_compile.c: Fix JIT…

Top Page
Delete this message
Author: Subversion repository
Date:  
To: pcre-svn
Subject: [Pcre-svn] [251] code/trunk/src/pcre2_jit_compile.c: Fix JIT assertion failure.
Revision: 251
          http://www.exim.org/viewvc/pcre2?view=rev&revision=251
Author:   zherczeg
Date:     2015-04-21 08:02:08 +0100 (Tue, 21 Apr 2015)


Log Message:
-----------
Fix JIT assertion failure.

Modified Paths:
--------------
    code/trunk/src/pcre2_jit_compile.c


Modified: code/trunk/src/pcre2_jit_compile.c
===================================================================
--- code/trunk/src/pcre2_jit_compile.c    2015-04-20 13:04:02 UTC (rev 250)
+++ code/trunk/src/pcre2_jit_compile.c    2015-04-21 07:02:08 UTC (rev 251)
@@ -1541,6 +1541,15 @@
   switch(*cc)
     {
     case OP_KET:
+    if (PRIVATE_DATA(cc) != 0)
+      {
+      private_data_length++;
+      SLJIT_ASSERT(PRIVATE_DATA(cc + 1) != 0);
+      cc += PRIVATE_DATA(cc + 1);
+      }
+    cc += 1 + LINK_SIZE;
+    break;
+
     case OP_ASSERT:
     case OP_ASSERT_NOT:
     case OP_ASSERTBACK:
@@ -1551,8 +1560,8 @@
     case OP_SBRA:
     case OP_SBRAPOS:
     case OP_SCOND:
-    if (PRIVATE_DATA(cc) != 0)
-      private_data_length++;
+    private_data_length++;
+    SLJIT_ASSERT(PRIVATE_DATA(cc) != 0);
     cc += 1 + LINK_SIZE;
     break;


@@ -1711,6 +1720,16 @@
     switch(*cc)
       {
       case OP_KET:
+      if (PRIVATE_DATA(cc) != 0)
+        {
+        count = 1;
+        srcw[0] = PRIVATE_DATA(cc);
+        SLJIT_ASSERT(PRIVATE_DATA(cc + 1) != 0);
+        cc += PRIVATE_DATA(cc + 1);
+        }
+      cc += 1 + LINK_SIZE;
+      break;
+
       case OP_ASSERT:
       case OP_ASSERT_NOT:
       case OP_ASSERTBACK:
@@ -1721,11 +1740,9 @@
       case OP_SBRA:
       case OP_SBRAPOS:
       case OP_SCOND:
-      if (PRIVATE_DATA(cc) != 0)
-        {
-        count = 1;
-        srcw[0] = PRIVATE_DATA(cc);
-        }
+      count = 1;
+      srcw[0] = PRIVATE_DATA(cc);
+      SLJIT_ASSERT(srcw[0] != 0);
       cc += 1 + LINK_SIZE;
       break;