• Home
  • Raw
  • Download

Lines Matching full:regex

4 Subject: [PATCH] glib/regex: Do not use JIT when using unsupported match
7 Do not store jit status for regex unless during initial compilation.
22 glib/tests/regex.c | 69 ++++++++++++++++++++++++++++++++++++++++++++++
49 enable_jit_with_match_options (GRegex *regex,
52 @@ -877,9 +884,13 @@ enable_jit_with_match_options (GRegex *regex,
55 if (!(regex->orig_compile_opts & G_REGEX_OPTIMIZE))
59 if (regex->jit_status == JIT_STATUS_DISABLED)
66 old_jit_options = regex->jit_options;
68 @@ -890,34 +901,34 @@ enable_jit_with_match_options (GRegex *regex,
73 + return regex->jit_status;
75 retval = pcre2_jit_compile (regex->pcre_re, new_jit_options);
79 - regex->jit_status = JIT_STATUS_ENABLED;
80 regex->jit_options = new_jit_options;
87 - regex->jit_status = JIT_STATUS_DISABLED;
94 - regex->jit_status = JIT_STATUS_DISABLED;
101 - regex->jit_status = JIT_STATUS_DISABLED;
106 + return regex->jit_status;
120 opts = match_info->regex->match_opts | match_info->match_opts;
122 - enable_jit_with_match_options (match_info->regex, opts);
123 - if (match_info->regex->jit_status == JIT_STATUS_ENABLED)
124 + jit_status = enable_jit_with_match_options (match_info->regex, opts);
127 match_info->matches = pcre2_jit_match (match_info->regex->pcre_re,
130 regex->orig_compile_opts = compile_options;
131 regex->match_opts = pcre_match_options;
132 regex->orig_match_opts = match_options;
133 - enable_jit_with_match_options (regex, regex->match_opts);
134 + regex->jit_status = enable_jit_with_match_options (regex, regex->match_opts);
136 return regex;
138 diff --git a/glib/tests/regex.c b/glib/tests/regex.c
140 --- a/glib/tests/regex.c
141 +++ b/glib/tests/regex.c
149 + GRegex *regex;
153 + regex = g_regex_new ("(\\w+)#(\\w+)", G_REGEX_OPTIMIZE, G_REGEX_MATCH_DEFAULT, NULL);
155 + g_assert_true (g_regex_match (regex, "aa#bb cc#dd", G_REGEX_MATCH_DEFAULT, &info));
174 + g_assert_true (g_regex_match (regex, "aa#bb cc#dd", G_REGEX_MATCH_ANCHORED, &info));
185 + g_assert_true (g_regex_match (regex, "aa#bb cc#dd", G_REGEX_MATCH_DEFAULT, &info));
204 + g_regex_unref (regex);
211 g_test_add_func ("/regex/explicit-crlf", test_explicit_crlf);
212 g_test_add_func ("/regex/max-lookbehind", test_max_lookbehind);
213 g_test_add_func ("/regex/compile-errors", test_compile_errors);
214 + g_test_add_func ("/regex/jit-unsupported-matching", test_jit_unsupported_matching_options);