File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -68,7 +68,7 @@ PHPAPI ZEND_DECLARE_MODULE_GLOBALS(pcre)
68
68
#define PCRE_JIT_STACK_MAX_SIZE (64 * 1024)
69
69
ZEND_TLS pcre_jit_stack * jit_stack = NULL ;
70
70
#endif
71
- #if defined(ZTS ) && defined( HAVE_PCRE_JIT_SUPPORT )
71
+ #if defined(ZTS )
72
72
static MUTEX_T pcre_mt = NULL ;
73
73
#define php_pcre_mutex_alloc () if (tsrm_is_main_thread() && !pcre_mt) pcre_mt = tsrm_mutex_alloc();
74
74
#define php_pcre_mutex_free () if (tsrm_is_main_thread() && pcre_mt) tsrm_mutex_free(pcre_mt); pcre_mt = NULL;
@@ -544,7 +544,9 @@ PHPAPI pcre_cache_entry* pcre_get_compiled_regex_cache(zend_string *regex)
544
544
/* If study option was specified, study the pattern and
545
545
store the result in extra for passing to pcre_exec. */
546
546
if (do_study ) {
547
+ php_pcre_mutex_lock ();
547
548
extra = pcre_study (re , soptions , & error );
549
+ php_pcre_mutex_unlock ();
548
550
if (extra ) {
549
551
extra -> flags |= PCRE_EXTRA_MATCH_LIMIT | PCRE_EXTRA_MATCH_LIMIT_RECURSION ;
550
552
extra -> match_limit = (unsigned long )PCRE_G (backtrack_limit );
You can’t perform that action at this time.
0 commit comments