Skip to content

Commit 7f9ad4a

Browse files
committed
Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1: Revert "Mangle PCRE regex cache key with JIT option"
2 parents c44f79b + 4d91665 commit 7f9ad4a

File tree

2 files changed

+3
-19
lines changed

2 files changed

+3
-19
lines changed

NEWS

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@ PHP NEWS
22
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
33
?? ??? ????, PHP 8.2.9
44

5-
- PCRE:
6-
. Mangle PCRE regex cache key with JIT option. (mvorisek)
7-
85
- PDO SQLite:
96
. Fix GH-11492 (Make test failure: ext/pdo_sqlite/tests/bug_42589.phpt).
107
(KapitanOczywisty, CViniciusSDias)

ext/pcre/php_pcre.c

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -612,24 +612,11 @@ PHPAPI pcre_cache_entry* pcre_get_compiled_regex_cache_ex(zend_string *regex, in
612612
pcre_cache_entry *ret;
613613

614614
if (locale_aware && BG(ctype_string)) {
615-
key = zend_string_concat3(
615+
key = zend_string_concat2(
616616
ZSTR_VAL(BG(ctype_string)), ZSTR_LEN(BG(ctype_string)),
617-
ZSTR_VAL(regex), ZSTR_LEN(regex),
618-
#ifdef HAVE_PCRE_JIT_SUPPORT
619-
PCRE_G(jit) ? "1" : "0", 1
620-
#else
621-
"", 0
622-
#endif
623-
);
617+
ZSTR_VAL(regex), ZSTR_LEN(regex));
624618
} else {
625-
#ifdef HAVE_PCRE_JIT_SUPPORT
626-
key = zend_string_concat2(
627-
ZSTR_VAL(regex), ZSTR_LEN(regex),
628-
PCRE_G(jit) ? "1" : "0", 1
629-
);
630-
#else
631619
key = regex;
632-
#endif
633620
}
634621

635622
/* Try to lookup the cached regex entry, and if successful, just pass
@@ -783,7 +770,7 @@ PHPAPI pcre_cache_entry* pcre_get_compiled_regex_cache_ex(zend_string *regex, in
783770
return NULL;
784771
}
785772

786-
if (locale_aware && BG(ctype_string)) {
773+
if (key != regex) {
787774
tables = (uint8_t *)zend_hash_find_ptr(&char_tables, BG(ctype_string));
788775
if (!tables) {
789776
zend_string *_k;

0 commit comments

Comments
 (0)