Skip to content

Commit 4d91665

Browse files
committed
Revert "Mangle PCRE regex cache key with JIT option"
This reverts commit 466fc78.
1 parent 039dd0b commit 4d91665

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
@@ -627,24 +627,11 @@ PHPAPI pcre_cache_entry* pcre_get_compiled_regex_cache_ex(zend_string *regex, in
627627
pcre_cache_entry *ret;
628628

629629
if (locale_aware && BG(ctype_string)) {
630-
key = zend_string_concat3(
630+
key = zend_string_concat2(
631631
ZSTR_VAL(BG(ctype_string)), ZSTR_LEN(BG(ctype_string)),
632-
ZSTR_VAL(regex), ZSTR_LEN(regex),
633-
#ifdef HAVE_PCRE_JIT_SUPPORT
634-
PCRE_G(jit) ? "1" : "0", 1
635-
#else
636-
"", 0
637-
#endif
638-
);
632+
ZSTR_VAL(regex), ZSTR_LEN(regex));
639633
} else {
640-
#ifdef HAVE_PCRE_JIT_SUPPORT
641-
key = zend_string_concat2(
642-
ZSTR_VAL(regex), ZSTR_LEN(regex),
643-
PCRE_G(jit) ? "1" : "0", 1
644-
);
645-
#else
646634
key = regex;
647-
#endif
648635
}
649636

650637
/* Try to lookup the cached regex entry, and if successful, just pass
@@ -799,7 +786,7 @@ PHPAPI pcre_cache_entry* pcre_get_compiled_regex_cache_ex(zend_string *regex, in
799786
return NULL;
800787
}
801788

802-
if (locale_aware && BG(ctype_string)) {
789+
if (key != regex) {
803790
tables = (uint8_t *)zend_hash_find_ptr(&char_tables, BG(ctype_string));
804791
if (!tables) {
805792
zend_string *_k;

0 commit comments

Comments
 (0)