summaryrefslogtreecommitdiff
path: root/ext/pcre/php_pcre.c
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2017-11-16 17:10:04 +0300
committerDmitry Stogov <dmitry@zend.com>2017-11-16 17:10:04 +0300
commit73bde7bbd0e2207383752581d10bdd92b897dd37 (patch)
tree5cc6fee8f4b403f8c14186ebca6fe5ca9ac59fc8 /ext/pcre/php_pcre.c
parentccc12b82da5dd10b44ab067b68b762298a9eb4eb (diff)
parenta370a6af647e27a334676a2c87bf686c6c973423 (diff)
downloadphp-git-73bde7bbd0e2207383752581d10bdd92b897dd37.tar.gz
Merge branch 'master' of git.php.net:php-src
* 'master' of git.php.net:php-src: Fix (*NO_JIT) usage when JIT is enabled Refactor ASCII to wide conversion
Diffstat (limited to 'ext/pcre/php_pcre.c')
-rw-r--r--ext/pcre/php_pcre.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/ext/pcre/php_pcre.c b/ext/pcre/php_pcre.c
index 82c0323f1c..f53f39352a 100644
--- a/ext/pcre/php_pcre.c
+++ b/ext/pcre/php_pcre.c
@@ -726,7 +726,10 @@ PHPAPI pcre_cache_entry* pcre_get_compiled_regex_cache(zend_string *regex)
/* Enable PCRE JIT compiler */
rc = pcre2_jit_compile(re, PCRE2_JIT_COMPLETE);
if (EXPECTED(rc >= 0)) {
- poptions |= PREG_JIT;
+ size_t jit_size = 0;
+ if (!pcre2_pattern_info(re, PCRE2_INFO_JITSIZE, &jit_size) && jit_size > 0) {
+ poptions |= PREG_JIT;
+ }
} else {
pcre2_get_error_message(rc, error, sizeof(error));
php_error_docref(NULL, E_WARNING, "JIT compilation failed: %s", error);