regex: Handle JIT errors more explicitly

This commit is contained in:
Marco Trevisan (Treviño) 2022-09-07 14:18:14 +02:00
parent fe1c2628d5
commit 5e76cde5ff

View File

@ -471,6 +471,7 @@ match_error (gint errcode)
/* not used by pcre2_match() */ /* not used by pcre2_match() */
break; break;
case PCRE2_ERROR_MATCHLIMIT: case PCRE2_ERROR_MATCHLIMIT:
case PCRE2_ERROR_JIT_STACKLIMIT:
return _("backtracking limit reached"); return _("backtracking limit reached");
case PCRE2_ERROR_CALLOUT: case PCRE2_ERROR_CALLOUT:
/* callouts are not implemented */ /* callouts are not implemented */
@ -912,8 +913,8 @@ enable_jit_with_match_options (GRegex *regex,
break; break;
default: default:
g_debug ("JIT compilation was requested with G_REGEX_OPTIMIZE, " g_debug ("JIT compilation was requested with G_REGEX_OPTIMIZE, "
"but request for JIT support had unexpectedly failed. " "but request for JIT support had unexpectedly failed (error %d). "
"Falling back to interpretive code."); "Falling back to interpretive code.", retval);
regex->jit_status = JIT_STATUS_DISABLED; regex->jit_status = JIT_STATUS_DISABLED;
break; break;
} }