summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2023-04-11 15:10:06 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2023-04-13 14:53:33 -0700
commit6e7253de1dd443be5f498078e1807ddfa4d364de (patch)
tree2695c13904cd15fd536f90bdf3f10e017223758a /src
parentfd2d0f7165d390ce4b4d08acf25552f6635d9ecb (diff)
downloadgrep-6e7253de1dd443be5f498078e1807ddfa4d364de.tar.gz
grep: make -P survive JIT compilation failure
* src/pcresearch.c (Pcompile): Ignore failure returns from pcre2_jit_compile.
Diffstat (limited to 'src')
-rw-r--r--src/pcresearch.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/pcresearch.c b/src/pcresearch.c
index 9e2f393d..e867f49f 100644
--- a/src/pcresearch.c
+++ b/src/pcresearch.c
@@ -243,9 +243,9 @@ Pcompile (char *pattern, idx_t size, reg_syntax_t ignored, bool exact)
pc->mcontext = NULL;
pc->data = pcre2_match_data_create_from_pattern (pc->cre, gcontext);
- ec = pcre2_jit_compile (pc->cre, PCRE2_JIT_COMPLETE);
- if (ec && ec != PCRE2_ERROR_JIT_BADOPTION && ec != PCRE2_ERROR_NOMEMORY)
- die (EXIT_TROUBLE, 0, _("JIT internal error: %d"), ec);
+ /* Ignore any failure return from pcre2_jit_compile, as that merely
+ means JIT won't be used during matching. */
+ pcre2_jit_compile (pc->cre, PCRE2_JIT_COMPLETE);
/* The PCRE documentation says that a 32 KiB stack is the default. */
pc->jit_stack = NULL;