add upstream patch for https://bugs.php.net/80682
  fix opcache doesn't honour pcre.jit option

(cherry picked from commit 1bcd8f70d4)
This commit is contained in:
Remi Collet 2021-02-03 08:04:53 +01:00
parent 9683d213c3
commit 31a0726b1d
3 changed files with 41 additions and 4 deletions

30
php-bug80682.patch Normal file
View File

@ -0,0 +1,30 @@
From 067f7e4150d8f9bddf6b198c9c7826565ee549b0 Mon Sep 17 00:00:00 2001
From: Remi Collet <remi@php.net>
Date: Thu, 28 Jan 2021 16:24:39 +0100
Subject: [PATCH] Fix #80682 opcache doesn't honour pcre.jit option
---
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 889fcabd7988..5c6bd76821a5 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 */

View File

@ -55,8 +55,8 @@
%bcond_with tidy
%endif
%global upver 7.4.14
#global rcver RC1
%global upver 7.4.15
#global rcver RC2
Summary: PHP scripting language for creating dynamic web sites
Name: php
@ -108,6 +108,7 @@ Patch45: php-7.4.0-ldap_r.patch
Patch47: php-7.4.8-phpinfo.patch
# Upstream fixes (100+)
Patch100: php-bug80682.patch
# Security fixes (200+)
@ -732,6 +733,7 @@ in pure PHP.
%patch47 -p1 -b .phpinfo
# upstream patches
%patch100 -p1 -b .bug80682
# security patches
@ -1537,6 +1539,11 @@ systemctl try-restart php-fpm.service >/dev/null 2>&1 || :
%changelog
* Tue Feb 2 2021 Remi Collet <remi@remirepo.net> - 7.4.15-1
- Update to 7.4.15 - http://www.php.net/releases/7_4_15.php
- add upstream patch for https://bugs.php.net/80682
fix opcache doesn't honour pcre.jit option
* Tue Jan 5 2021 Remi Collet <remi@remirepo.net> - 7.4.14-1
- Update to 7.4.14 - http://www.php.net/releases/7_4_14.php
- explicitly requires make

View File

@ -1,2 +1,2 @@
SHA512 (php-7.4.14.tar.xz) = 5c48874d1e78d83297e98773089993ee3c8a7cdd8a611afc536eed8bc91cc4b2b492e1940923ccb7fe2dd039732082e568191e64923b74d4fc80362fbd06e6b7
SHA512 (php-7.4.14.tar.xz.asc) = 02aec8468ac89e262c83cff26d8e6777fd9e3704256e4885872486fc536db996c94b966fcc7ef8964b881c03a325b2ec3701db750920c03860af3ee4cbb62468
SHA512 (php-7.4.15.tar.xz) = 51a815852c08518d6706fc719e3bafd214889580cc5ca0e5049ae7e8f6173e83b9486bc9a69afd1ea4ab1778bb2879bd917595cd04cbcc50b182a10230f08175
SHA512 (php-7.4.15.tar.xz.asc) = d5502e77753888a4b5d98b6f3cd01ae7e7a7b94700375017e0783ba19462c117e12bd156b51462d426c1101c318be0ef9fa04d5b5eed476fc4d686693896cd73