summaryrefslogtreecommitdiff
path: root/ext/pcre/php_pcre.c
diff options
context:
space:
mode:
authorAaron Piotrowski <aaron@trowski.com>2016-07-03 22:42:10 -0500
committerAaron Piotrowski <aaron@trowski.com>2016-07-03 22:42:10 -0500
commitd9a9cf8ecaef891b2369969e9efe9f6261359158 (patch)
tree04bcc83b3c9be1924007e007e1f508f7229af7ab /ext/pcre/php_pcre.c
parent583386d59e6b362fe49e51594718a109d0c0cc2f (diff)
parentc2b29a58bc0916e248ba2584564558097b16b51f (diff)
downloadphp-git-d9a9cf8ecaef891b2369969e9efe9f6261359158.tar.gz
Merge branch 'master' into iterable
Diffstat (limited to 'ext/pcre/php_pcre.c')
-rw-r--r--ext/pcre/php_pcre.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/pcre/php_pcre.c b/ext/pcre/php_pcre.c
index 9225c0f976..dbb9c6abec 100644
--- a/ext/pcre/php_pcre.c
+++ b/ext/pcre/php_pcre.c
@@ -216,7 +216,7 @@ static PHP_MSHUTDOWN_FUNCTION(pcre)
/* {{{ PHP_RINIT_FUNCTION(pcre) */
static PHP_RINIT_FUNCTION(pcre)
{
- if (PCRE_G(jit)) {
+ if (PCRE_G(jit) && jit_stack == NULL) {
jit_stack = pcre_jit_stack_alloc(PCRE_JIT_STACK_MIN_SIZE,PCRE_JIT_STACK_MAX_SIZE);
}
@@ -1331,7 +1331,7 @@ PHPAPI zend_string *php_pcre_replace_impl(pcre_cache_entry *pce, zend_string *su
break;
}
new_len = result_len + subject_len - start_offset;
- if (new_len > alloc_len) {
+ if (new_len >= alloc_len) {
alloc_len = new_len; /* now we know exactly how long it is */
if (NULL != result) {
result = zend_string_realloc(result, alloc_len, 0);