• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1From 5e76cde5ffeac79b939cf84202024859cda5e753 Mon Sep 17 00:00:00 2001
2From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= <mail@3v1n0.net>
3Date: Wed, 7 Sep 2022 14:18:14 +0200
4Subject: [PATCH] regex: Handle JIT errors more explicitly
5
6---
7 glib/gregex.c | 5 +++--
8 1 file changed, 3 insertions(+), 2 deletions(-)
9
10diff --git a/glib/gregex.c b/glib/gregex.c
11index 7d403ad53d..fe7473e628 100644
12--- a/glib/gregex.c
13+++ b/glib/gregex.c
14@@ -471,6 +471,7 @@ match_error (gint errcode)
15       /* not used by pcre2_match() */
16       break;
17     case PCRE2_ERROR_MATCHLIMIT:
18+    case PCRE2_ERROR_JIT_STACKLIMIT:
19       return _("backtracking limit reached");
20     case PCRE2_ERROR_CALLOUT:
21       /* callouts are not implemented */
22@@ -912,8 +913,8 @@ enable_jit_with_match_options (GRegex   *regex,
23       break;
24     default:
25       g_debug ("JIT compilation was requested with G_REGEX_OPTIMIZE, "
26-               "but request for JIT support had unexpectedly failed. "
27-               "Falling back to interpretive code.");
28+               "but request for JIT support had unexpectedly failed (error %d). "
29+               "Falling back to interpretive code.", retval);
30       regex->jit_status = JIT_STATUS_DISABLED;
31       break;
32     }
33--
34GitLab
35
36