[Pcre-svn] [1660] code/trunk: Fix register overwite in JIT w…

Top Page
Delete this message
Author: Subversion repository
Date:  
To: pcre-svn
Subject: [Pcre-svn] [1660] code/trunk: Fix register overwite in JIT when SSE2 acceleration is enabled.
Revision: 1660
          http://vcs.pcre.org/viewvc?view=rev&revision=1660
Author:   zherczeg
Date:     2016-07-01 10:06:38 +0100 (Fri, 01 Jul 2016)
Log Message:
-----------
Fix register overwite in JIT when SSE2 acceleration is enabled.


Modified Paths:
--------------
    code/trunk/ChangeLog
    code/trunk/pcre_jit_compile.c
    code/trunk/pcre_jit_test.c


Modified: code/trunk/ChangeLog
===================================================================
--- code/trunk/ChangeLog    2016-06-24 09:01:23 UTC (rev 1659)
+++ code/trunk/ChangeLog    2016-07-01 09:06:38 UTC (rev 1660)
@@ -9,11 +9,13 @@


 1.  Using -o with -M in pcregrep could cause unnecessary repeated output when
     the match extended over a line boundary.
-    
+
 2.  Applied Chris Wilson's second patch (Bugzilla #1681) to CMakeLists.txt for
     MSVC static compilation, putting the first patch under a new option.
-     


+3. Fix register overwite in JIT when SSE2 acceleration is enabled.
+
+
Version 8.39 14-June-2016
-------------------------


Modified: code/trunk/pcre_jit_compile.c
===================================================================
--- code/trunk/pcre_jit_compile.c    2016-06-24 09:01:23 UTC (rev 1659)
+++ code/trunk/pcre_jit_compile.c    2016-07-01 09:06:38 UTC (rev 1660)
@@ -4004,12 +4004,12 @@


if (load_twice)
{
- OP1(SLJIT_MOV, TMP3, 0, TMP2, 0);
+ OP1(SLJIT_MOV, RETURN_ADDR, 0, TMP2, 0);
instruction[3] = 0xc0 | (tmp2_ind << 3) | 1;
sljit_emit_op_custom(compiler, instruction, 4);

OP2(SLJIT_OR, TMP1, 0, TMP1, 0, TMP2, 0);
- OP1(SLJIT_MOV, TMP2, 0, TMP3, 0);
+ OP1(SLJIT_MOV, TMP2, 0, RETURN_ADDR, 0);
}

OP2(SLJIT_ASHR, TMP1, 0, TMP1, 0, TMP2, 0);

Modified: code/trunk/pcre_jit_test.c
===================================================================
--- code/trunk/pcre_jit_test.c    2016-06-24 09:01:23 UTC (rev 1659)
+++ code/trunk/pcre_jit_test.c    2016-07-01 09:06:38 UTC (rev 1660)
@@ -687,6 +687,7 @@
     { PCRE_FIRSTLINE | PCRE_NEWLINE_LF | PCRE_DOTALL, 0 | F_NOMATCH, "ab.", "ab" },
     { MUA | PCRE_FIRSTLINE, 1 | F_NOMATCH, "^[a-d0-9]", "\nxx\nd" },
     { PCRE_NEWLINE_ANY | PCRE_FIRSTLINE | PCRE_DOTALL, 0, "....a", "012\n0a" },
+    { MUA | PCRE_FIRSTLINE, 0, "[aC]", "a" },


     /* Recurse. */
     { MUA, 0, "(a)(?1)", "aa" },