]> granicus.if.org Git - php/commitdiff
Fix #80682 opcache doesn't honour pcre.jit option
authorRemi Collet <remi@php.net>
Thu, 28 Jan 2021 15:24:39 +0000 (16:24 +0100)
committerRemi Collet <remi@php.net>
Thu, 28 Jan 2021 15:24:39 +0000 (16:24 +0100)
ext/opcache/zend_accelerator_blacklist.c

index 889fcabd798875f40181c3c780f61719b4726805..5c6bd76821a5adeb346121cecdcf67a942440964 100644 (file)
@@ -185,10 +185,12 @@ static void zend_accel_blacklist_update_regexp(zend_blacklist *blacklist)
                                return;
                        }
 #ifdef HAVE_PCRE_JIT_SUPPORT
-                       if (0 > pcre2_jit_compile(it->re, PCRE2_JIT_COMPLETE)) {
-                               /* Don't return here, even JIT could fail to compile, the pattern is still usable. */
-                               pcre2_get_error_message(errnumber, pcre_error, sizeof(pcre_error));
-                               zend_accel_error(ACCEL_LOG_WARNING, "Blacklist JIT compilation failed, %s\n", pcre_error);
+                       if (PCRE_G(jit)) {
+                               if (0 > pcre2_jit_compile(it->re, PCRE2_JIT_COMPLETE)) {
+                                       /* Don't return here, even JIT could fail to compile, the pattern is still usable. */
+                                       pcre2_get_error_message(errnumber, pcre_error, sizeof(pcre_error));
+                                       zend_accel_error(ACCEL_LOG_WARNING, "Blacklist JIT compilation failed, %s\n", pcre_error);
+                               }
                        }
 #endif
                        /* prepare for the next iteration */