[Pcre-svn] [1715] code/trunk: Fix pcre_jit_exec early check.

Top Page
Delete this message
Author: Subversion repository
Date:  
To: pcre-svn
Subject: [Pcre-svn] [1715] code/trunk: Fix pcre_jit_exec early check.
Revision: 1715
          http://vcs.pcre.org/viewvc?view=rev&revision=1715
Author:   zherczeg
Date:     2017-11-23 07:56:49 +0000 (Thu, 23 Nov 2017)
Log Message:
-----------
Fix pcre_jit_exec early check.


Modified Paths:
--------------
    code/trunk/ChangeLog
    code/trunk/pcre_jit_compile.c


Modified: code/trunk/ChangeLog
===================================================================
--- code/trunk/ChangeLog    2017-11-16 18:00:54 UTC (rev 1714)
+++ code/trunk/ChangeLog    2017-11-23 07:56:49 UTC (rev 1715)
@@ -21,7 +21,12 @@
 this character" item such as [^\x{1234}] (with a code point greater than 127)
 because the "other case" variable was not being initialized.


+5. Although pcre_jit_exec 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 pcre_jit_exec returns with PCRE_ERROR_JIT_BADOPTION
+when the pattern is not optimized by JIT at all.

+
Version 8.41 05-July-2017
-------------------------


Modified: code/trunk/pcre_jit_compile.c
===================================================================
--- code/trunk/pcre_jit_compile.c    2017-11-16 18:00:54 UTC (rev 1714)
+++ code/trunk/pcre_jit_compile.c    2017-11-23 07:56:49 UTC (rev 1715)
@@ -11529,7 +11529,7 @@
 else if ((options & PCRE_PARTIAL_SOFT) != 0)
   mode = JIT_PARTIAL_SOFT_COMPILE;


-if (functions->executable_funcs[mode] == NULL)
+if (functions->executable_funcs == NULL || functions->executable_funcs[mode] == NULL)
return PCRE_ERROR_JIT_BADOPTION;

/* Sanity checks should be handled by pcre_exec. */