Skip to content

Commit ddf1700

Browse files
committed
Store JIT/non-JIT regex in a different PCRE cache slot
1 parent 6e04050 commit ddf1700

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

ext/pcre/php_pcre.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -612,9 +612,15 @@ 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_concat2(
615+
key = zend_string_concat3(
616616
ZSTR_VAL(BG(ctype_string)), ZSTR_LEN(BG(ctype_string)),
617-
ZSTR_VAL(regex), ZSTR_LEN(regex));
617+
ZSTR_VAL(regex), ZSTR_LEN(regex),
618+
#ifdef HAVE_PCRE_JIT_SUPPORT
619+
PCRE_G(jit) ? "1" : "0", 1
620+
#else
621+
"0", 1
622+
#endif
623+
);
618624
} else {
619625
key = regex;
620626
}

0 commit comments

Comments
 (0)