From 266f19babbd26a58d20d40f2af25482f4a1d0d90 Mon Sep 17 00:00:00 2001 From: Xinchen Hui Date: Tue, 14 Nov 2017 10:50:41 +0800 Subject: [PATCH] Added PCRE_JIT_SUPPORT flag --- ext/pcre/php_pcre.c | 6 ++++++ sapi/cli/tests/006.phpt | 6 +++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/ext/pcre/php_pcre.c b/ext/pcre/php_pcre.c index d528105f77..ed314622cc 100644 --- a/ext/pcre/php_pcre.c +++ b/ext/pcre/php_pcre.c @@ -392,6 +392,12 @@ static PHP_MINIT_FUNCTION(pcre) REGISTER_LONG_CONSTANT("PCRE_VERSION_MAJOR", PCRE2_MAJOR, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("PCRE_VERSION_MINOR", PCRE2_MINOR, CONST_CS | CONST_PERSISTENT); +#ifdef HAVE_PCRE_JIT_SUPPORT + REGISTER_BOOL_CONSTANT("PCRE_JIT_SUPPORT", 1, CONST_CS | CONST_PERSISTENT); +#else + REGISTER_BOOL_CONSTANT("PCRE_JIT_SUPPORT", 0, CONST_CS | CONST_PERSISTENT); +#endif + return SUCCESS; } /* }}} */ diff --git a/sapi/cli/tests/006.phpt b/sapi/cli/tests/006.phpt index 402fc1f468..72f0c5dfa5 100644 --- a/sapi/cli/tests/006.phpt +++ b/sapi/cli/tests/006.phpt @@ -6,6 +6,9 @@ include "skipif.inc"; if (!extension_loaded("reflection") || !extension_loaded("session")) { die("skip reflection and session extensions required"); } +if (PCRE_JIT_SUPPORT == false) { + die ("skip not pcre jit support builtin"); +} ?> --INI-- date.timezone= @@ -39,7 +42,7 @@ string(%d) "Extension [ extension #%d pcre version %s ] { } } - - Constants [18] { + - Constants [19] { Constant [ integer PREG_PATTERN_ORDER ] { 1 } Constant [ integer PREG_SET_ORDER ] { 2 } Constant [ integer PREG_OFFSET_CAPTURE ] { 256 } @@ -58,6 +61,7 @@ string(%d) "Extension [ extension #%d pcre version %s ] { Constant [ string PCRE_VERSION ] { %s } Constant [ integer PCRE_VERSION_MAJOR ] { %d } Constant [ integer PCRE_VERSION_MINOR ] { %d } + Constant [ boolean PCRE_JIT_SUPPORT ] { %d } } - Functions { -- 2.50.1