Fix pcre2_jit_match early check.

This commit is contained in:
Zoltán Herczeg 2017-11-23 07:54:39 +00:00
parent 2881730084
commit f93d278054
2 changed files with 6 additions and 1 deletions

View File

@ -55,6 +55,11 @@ All these issues should now be fixed.
compressed file (.gz or .bz2) a segfault occurred. (Line buffering should be compressed file (.gz or .bz2) a segfault occurred. (Line buffering should be
ignored for compressed files.) ignored for compressed files.)
15. Although pcre2_jit_match checks whether the pattern is compiled
in a given mode, it was also expected that at least one mode is available.
This is fixed and pcre2_jit_match returns with PCRE2_ERROR_JIT_BADOPTION
when the pattern is not optimized by JIT at all.
Version 10.30 14-August-2017 Version 10.30 14-August-2017
---------------------------- ----------------------------

View File

@ -118,7 +118,7 @@ if ((options & PCRE2_PARTIAL_HARD) != 0)
else if ((options & PCRE2_PARTIAL_SOFT) != 0) else if ((options & PCRE2_PARTIAL_SOFT) != 0)
index = 1; index = 1;
if (functions->executable_funcs[index] == NULL) if (functions->executable_funcs == NULL || functions->executable_funcs[index] == NULL)
return PCRE2_ERROR_JIT_BADOPTION; return PCRE2_ERROR_JIT_BADOPTION;
/* Sanity checks should be handled by pcre_exec. */ /* Sanity checks should be handled by pcre_exec. */