summaryrefslogtreecommitdiff
path: root/src/pcre2_jit_test.c
diff options
context:
space:
mode:
authorzherczeg <zherczeg@6239d852-aaf2-0410-a92c-79f79f948069>2018-09-16 10:35:00 +0000
committerzherczeg <zherczeg@6239d852-aaf2-0410-a92c-79f79f948069>2018-09-16 10:35:00 +0000
commitdd7fb58cfa58fd60285f43798750be85127e75f7 (patch)
treee68664daaf503f57113a33a08cf5cb3c6899da00 /src/pcre2_jit_test.c
parente760cb60f77c5d68a9c06ae2761ddcf7bb6e1d1d (diff)
downloadpcre2-dd7fb58cfa58fd60285f43798750be85127e75f7.tar.gz
Improve invalid UTF character reading in JIT.
git-svn-id: svn://vcs.exim.org/pcre2/code/trunk@1008 6239d852-aaf2-0410-a92c-79f79f948069
Diffstat (limited to 'src/pcre2_jit_test.c')
-rw-r--r--src/pcre2_jit_test.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/pcre2_jit_test.c b/src/pcre2_jit_test.c
index 27553b4..748398b 100644
--- a/src/pcre2_jit_test.c
+++ b/src/pcre2_jit_test.c
@@ -1757,7 +1757,7 @@ static int regression_tests(void)
#if defined SUPPORT_UNICODE && (defined SUPPORT_PCRE2_8 || defined SUPPORT_PCRE2_16)
-static int check_invalid_utf_result(int pattern_index, char *type, int result,
+static int check_invalid_utf_result(int pattern_index, const char *type, int result,
int match_start, int match_end, PCRE2_SIZE *ovector)
{
if (match_start < 0) {
@@ -1926,6 +1926,15 @@ static struct invalid_utf8_regression_test_case invalid_utf8_regression_test_cas
{ PCRE2_UTF | PCRE2_MULTILINE, CI, 1, 0, 0, 5, 6, { "^\\W", NULL }, " \xf2\xbf\xbf\x0a#"},
{ PCRE2_UTF | PCRE2_MULTILINE, CI, 1, 0, 0, 3, 4, { "^\\W", NULL }, " \xef\x0a#"},
{ PCRE2_UTF | PCRE2_MULTILINE, CI, 1, 0, 0, 4, 5, { "^\\W", NULL }, " \xef\xbf\x0a#"},
+ { PCRE2_UTF | PCRE2_MULTILINE, CI, 1, 0, 0, 5, 6, { "^\\W", NULL }, " \x85#\xc2\x85#"},
+ { PCRE2_UTF | PCRE2_MULTILINE, CI, 1, 0, 0, 7, 8, { "^\\W", NULL }, " \xe2\x80\xf8\xe2\x80\xa8#"},
+
+ { PCRE2_UTF | PCRE2_FIRSTLINE, CI, 0, 0, 0, -1, -1, { "#", NULL }, "\xe2\x80\xf8\xe2\x80\xa8#"},
+ { PCRE2_UTF | PCRE2_FIRSTLINE, CI, 0, 0, 0, 3, 4, { "#", NULL }, "\xe2\x80\xf8#\xe2\x80\xa8#"},
+ { PCRE2_UTF | PCRE2_FIRSTLINE, CI, 0, 0, 0, -1, -1, { "#", NULL }, "abcd\xc2\x85#"},
+ { PCRE2_UTF | PCRE2_FIRSTLINE, CI, 0, 0, 0, 1, 2, { "#", NULL }, "\x85#\xc2\x85#"},
+ { PCRE2_UTF | PCRE2_FIRSTLINE, CI, 0, 0, 0, 5, 6, { "#", NULL }, "\xef,\x80,\xf8#\x0a"},
+ { PCRE2_UTF | PCRE2_FIRSTLINE, CI, 0, 0, 0, -1, -1, { "#", NULL }, "\xef,\x80,\xf8\x0a#"},
{ 0, 0, 0, 0, 0, 0, 0, { NULL, NULL }, NULL }
};