summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzherczeg <zherczeg@6239d852-aaf2-0410-a92c-79f79f948069>2020-10-27 08:16:04 +0000
committerzherczeg <zherczeg@6239d852-aaf2-0410-a92c-79f79f948069>2020-10-27 08:16:04 +0000
commitfd5e04a35122c62584da5a9558f3b744a2d09692 (patch)
treeb4d349b77d5b551e5e0401deeb83cf627a1b650a
parent552c76a6739764036817434db45b496d1461e764 (diff)
downloadpcre2-fd5e04a35122c62584da5a9558f3b744a2d09692.tar.gz
Fixed a word boundary check bug in JIT when partial matching is enabled.
git-svn-id: svn://vcs.exim.org/pcre2/code/trunk@1280 6239d852-aaf2-0410-a92c-79f79f948069
-rw-r--r--ChangeLog2
-rw-r--r--src/pcre2_jit_compile.c2
-rw-r--r--testdata/testinput104
-rw-r--r--testdata/testoutput106
4 files changed, 14 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 93b1ad6..5db7e65 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -90,6 +90,8 @@ whose code points are greater than 255 in Unicode mode.
test for a version of sed that can handle binary zero, instead of assuming that
any Linux version will work.
+18. Fixed a word boundary check bug in JIT when partial matching is enabled.
+
Version 10.35 09-May-2020
---------------------------
diff --git a/src/pcre2_jit_compile.c b/src/pcre2_jit_compile.c
index 04f0278..1977d28 100644
--- a/src/pcre2_jit_compile.c
+++ b/src/pcre2_jit_compile.c
@@ -6571,9 +6571,11 @@ if (common->invalid_utf)
if (common->mode != PCRE2_JIT_COMPLETE)
{
+ OP1(SLJIT_MOV, RETURN_ADDR, 0, TMP1, 0);
OP1(SLJIT_MOV, TMP2, 0, STR_PTR, 0);
move_back(common, NULL, TRUE);
check_start_used_ptr(common);
+ OP1(SLJIT_MOV, TMP1, 0, RETURN_ADDR, 0);
OP1(SLJIT_MOV, STR_PTR, 0, TMP2, 0);
}
}
diff --git a/testdata/testinput10 b/testdata/testinput10
index efd3298..53e37cb 100644
--- a/testdata/testinput10
+++ b/testdata/testinput10
@@ -613,4 +613,8 @@
/A/utf,match_invalid_utf,caseless
\xe5A
+/\bch\b/utf,match_invalid_utf
+ qchq\=ph
+ qchq\=ps
+
# End of testinput10
diff --git a/testdata/testoutput10 b/testdata/testoutput10
index 2a3803f..d408510 100644
--- a/testdata/testoutput10
+++ b/testdata/testoutput10
@@ -1875,4 +1875,10 @@ Subject length lower bound = 1
\xe5A
0: A
+/\bch\b/utf,match_invalid_utf
+ qchq\=ph
+Partial match:
+ qchq\=ps
+Partial match:
+
# End of testinput10