diff --git a/ChangeLog b/ChangeLog index 6b8b9a4..47f5835 100644 --- a/ChangeLog +++ b/ChangeLog @@ -166,6 +166,8 @@ it fails when running the interpreter with a 16M stack (and if changing the stack size via pcre2test is possible). This avoids having to manually set a large stack size when testing with clang. +42. Fix register overwite in JIT when SSE2 acceleration is enabled. + Version 10.21 12-January-2016 ----------------------------- diff --git a/src/pcre2_jit_compile.c b/src/pcre2_jit_compile.c index c98f977..8dea90a 100644 --- a/src/pcre2_jit_compile.c +++ b/src/pcre2_jit_compile.c @@ -4027,12 +4027,12 @@ sljit_emit_op_custom(compiler, instruction, 4); 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); diff --git a/src/pcre2_jit_test.c b/src/pcre2_jit_test.c index dfe0032..705ba18 100644 --- a/src/pcre2_jit_test.c +++ b/src/pcre2_jit_test.c @@ -692,6 +692,7 @@ static struct regression_test_case regression_test_cases[] = { { PCRE2_FIRSTLINE | PCRE2_DOTALL, PCRE2_NEWLINE_LF, 0, 0 | F_NOMATCH, "ab.", "ab" }, { MU | PCRE2_FIRSTLINE, A, 0, 1 | F_NOMATCH, "^[a-d0-9]", "\nxx\nd" }, { PCRE2_FIRSTLINE | PCRE2_DOTALL, PCRE2_NEWLINE_ANY, 0, 0, "....a", "012\n0a" }, + { MU | PCRE2_FIRSTLINE, A, 0, 0, "[aC]", "a" }, /* Recurse. */ { MU, A, 0, 0, "(a)(?1)", "aa" },