com php-src: Backport 96a12578c13b5c37195b10526fcdc669b795644d: ext/opcache/ZendAccelerator.c

From: Date: Tue, 18 Jun 2019 05:48:59 +0000
Subject: com php-src: Backport 96a12578c13b5c37195b10526fcdc669b795644d: ext/opcache/ZendAccelerator.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-106847@lists.php.net to get a copy of this message
Commit: 99dde02e11a02054e7f357738c2e362ab460bbcb Author: Dmitry Stogov <dmitry@zend.com> Fri, 14 Jun 2019 13:29:13 +0300 Committer: Remi Collet <remi@php.net> Tue, 18 Jun 2019 07:48:59 +0200 Parents: 6c225a63189bd1c0649c709d46112e0bf01f13b2 Branches: PHP-7.2.20 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=99dde02e11a02054e7f357738c2e362ab460bbcb Log: Backport 96a12578c13b5c37195b10526fcdc669b795644d (cherry picked from commit 28808ca96d202e63db0c407548f4fb7d4cb46d9f) Changed paths: M ext/opcache/ZendAccelerator.c Diff: diff --git a/ext/opcache/ZendAccelerator.c b/ext/opcache/ZendAccelerator.c index 91436d5..70508b6 100644 --- a/ext/opcache/ZendAccelerator.c +++ b/ext/opcache/ZendAccelerator.c @@ -413,7 +413,7 @@ static zend_string *accel_find_interned_string(zend_string *str) if (!ZCG(counted)) { if (!ZCG(accelerator_enabled) || accel_activate_add() == FAILURE) { - return str; + return NULL; } ZCG(counted) = 1; } @@ -658,10 +658,9 @@ static void accel_use_shm_interned_strings(void) if (ZCSG(interned_strings_saved_top) == NULL) { accel_copy_permanent_strings(accel_new_interned_string); } else { + ZCG(counted) = 1; accel_copy_permanent_strings(accel_replace_string_by_shm_permanent); - if (ZCG(counted)) { - accel_deactivate_sub(); - } + ZCG(counted) = 0; } accel_interned_strings_save_state(); @@ -1093,7 +1092,11 @@ char *accel_make_persistent_key(const char *path, int path_length, int *key_len) cwd_len = ZCG(cwd_key_len) = buf + sizeof(buf) - 1 - res; cwd = ZCG(cwd_key); memcpy(ZCG(cwd_key), res, cwd_len + 1); + } else { + return NULL; } + } else { + return NULL; } } } @@ -1132,7 +1135,11 @@ char *accel_make_persistent_key(const char *path, int path_length, int *key_len) include_path_len = ZCG(include_path_key_len) = buf + sizeof(buf) - 1 - res; include_path = ZCG(include_path_key); memcpy(ZCG(include_path_key), res, include_path_len + 1); + } else { + return NULL; } + } else { + return NULL; } } } @@ -2179,6 +2186,7 @@ static void accel_reset_pcre_cache(void) static void accel_activate(void) { if (!ZCG(enabled) || !accel_startup_ok) { + ZCG(accelerator_enabled) = 0; return; } @@ -2206,6 +2214,7 @@ static void accel_activate(void) #ifdef HAVE_OPCACHE_FILE_CACHE if (file_cache_only) { + ZCG(accelerator_enabled) = 0; return; } #endif

« previous php.cvs (#106847) next »