Skip to content

Commit 33e2868

Browse files
committed
Merge branch 'PHP-8.2'
* PHP-8.2: Revert "Mangle PCRE regex cache key with JIT option"
2 parents 724af01 + 7f9ad4a commit 33e2868

File tree

1 file changed

+3
-16
lines changed

1 file changed

+3
-16
lines changed

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)