[glib/wip/3v1n0/regex-pcre2-flags-fixes: 8/11] regex: Handle JIT errors more explicitly




commit f63e05992fde61406bc0ca2285ed32454a82854c
Author: Marco Trevisan (TreviƱo) <mail 3v1n0 net>
Date:   Wed Sep 7 14:18:14 2022 +0200

    regex: Handle JIT errors more explicitly

 glib/gregex.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/glib/gregex.c b/glib/gregex.c
index 7d403ad53d..fe7473e628 100644
--- a/glib/gregex.c
+++ b/glib/gregex.c
@@ -471,6 +471,7 @@ match_error (gint errcode)
       /* not used by pcre2_match() */
       break;
     case PCRE2_ERROR_MATCHLIMIT:
+    case PCRE2_ERROR_JIT_STACKLIMIT:
       return _("backtracking limit reached");
     case PCRE2_ERROR_CALLOUT:
       /* callouts are not implemented */
@@ -912,8 +913,8 @@ enable_jit_with_match_options (GRegex   *regex,
       break;
     default:
       g_debug ("JIT compilation was requested with G_REGEX_OPTIMIZE, "
-               "but request for JIT support had unexpectedly failed. "
-               "Falling back to interpretive code.");
+               "but request for JIT support had unexpectedly failed (error %d). "
+               "Falling back to interpretive code.", retval);
       regex->jit_status = JIT_STATUS_DISABLED;
       break;
     }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]