From 716ccfad4c4fcc47e5c33043574978174f884540 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Thu, 28 Jan 2021 14:36:10 +0100 Subject: [PATCH] use pcre.jit only if enabled --- ext/opcache/zend_accelerator_blacklist.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/ext/opcache/zend_accelerator_blacklist.c b/ext/opcache/zend_accelerator_blacklist.c index 889fcabd79887..5c6bd76821a5a 100644 --- a/ext/opcache/zend_accelerator_blacklist.c +++ b/ext/opcache/zend_accelerator_blacklist.c @@ -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 */