diff --git a/src/pcre2.h.generic b/src/pcre2.h.generic index dad774ce6..dc8ad0752 100644 --- a/src/pcre2.h.generic +++ b/src/pcre2.h.generic @@ -404,6 +404,7 @@ released, the numbers must not be changed. */ #define PCRE2_ERROR_CONVERT_SYNTAX (-64) #define PCRE2_ERROR_INTERNAL_DUPMATCH (-65) #define PCRE2_ERROR_DFA_UINVALID_UTF (-66) +#define PCRE2_ERROR_JIT_UNSUPPORTED (-67) /* Request types for pcre2_pattern_info() */ diff --git a/src/pcre2.h.in b/src/pcre2.h.in index 7202c6337..661a79e7c 100644 --- a/src/pcre2.h.in +++ b/src/pcre2.h.in @@ -404,6 +404,7 @@ released, the numbers must not be changed. */ #define PCRE2_ERROR_CONVERT_SYNTAX (-64) #define PCRE2_ERROR_INTERNAL_DUPMATCH (-65) #define PCRE2_ERROR_DFA_UINVALID_UTF (-66) +#define PCRE2_ERROR_JIT_UNSUPPORTED (-67) /* Request types for pcre2_pattern_info() */ diff --git a/src/pcre2_error.c b/src/pcre2_error.c index 09904c03e..83f2c605b 100644 --- a/src/pcre2_error.c +++ b/src/pcre2_error.c @@ -272,6 +272,7 @@ static const unsigned char match_error_texts[] = /* 65 */ "internal error - duplicate substitution match\0" "PCRE2_MATCH_INVALID_UTF is not supported for DFA matching\0" + "pattern not supported by JIT\0" ; diff --git a/src/pcre2_jit_compile.c b/src/pcre2_jit_compile.c index 1f84293be..f1c2ee9c1 100644 --- a/src/pcre2_jit_compile.c +++ b/src/pcre2_jit_compile.c @@ -13844,7 +13844,7 @@ common->ovector_start += sizeof(sljit_sw); if (!check_opcode_types(common, common->start, ccend)) { SLJIT_FREE(common->optimized_cbracket, allocator_data); - return PCRE2_ERROR_NOMEMORY; + return PCRE2_ERROR_JIT_UNSUPPORTED; } /* Checking flags and updating ovector_start. */ @@ -13919,7 +13919,7 @@ if (private_data_size > SLJIT_MAX_LOCAL_SIZE) { SLJIT_FREE(common->private_data_ptrs, allocator_data); SLJIT_FREE(common->optimized_cbracket, allocator_data); - return PCRE2_ERROR_NOMEMORY; + return PCRE2_ERROR_JIT_UNSUPPORTED; } if (common->has_then) diff --git a/testdata/testoutput17 b/testdata/testoutput17 index b5b2cc8a1..bbcab1f5e 100644 --- a/testdata/testoutput17 +++ b/testdata/testoutput17 @@ -9,7 +9,7 @@ Capture group count = 0 May match empty string Subject length lower bound = 0 -JIT compilation was not successful (no more memory) +JIT compilation was not successful (pattern not supported by JIT) # The following pattern cannot be compiled by JIT. @@ -17,7 +17,7 @@ JIT compilation was not successful (no more memory) Capture group count = 0 May match empty string Subject length lower bound = 0 -JIT compilation was not successful (no more memory) +JIT compilation was not successful (pattern not supported by JIT) # Check that an infinite recursion loop is caught.