Skip to content

Commit 28808ca

Browse files
committed
Backport 96a1257
1 parent 40f463b commit 28808ca

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

ext/opcache/ZendAccelerator.c

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@ static zend_string *accel_find_interned_string(zend_string *str)
413413

414414
if (!ZCG(counted)) {
415415
if (!ZCG(accelerator_enabled) || accel_activate_add() == FAILURE) {
416-
return str;
416+
return NULL;
417417
}
418418
ZCG(counted) = 1;
419419
}
@@ -658,10 +658,9 @@ static void accel_use_shm_interned_strings(void)
658658
if (ZCSG(interned_strings_saved_top) == NULL) {
659659
accel_copy_permanent_strings(accel_new_interned_string);
660660
} else {
661+
ZCG(counted) = 1;
661662
accel_copy_permanent_strings(accel_replace_string_by_shm_permanent);
662-
if (ZCG(counted)) {
663-
accel_deactivate_sub();
664-
}
663+
ZCG(counted) = 0;
665664
}
666665
accel_interned_strings_save_state();
667666

@@ -1093,7 +1092,11 @@ char *accel_make_persistent_key(const char *path, int path_length, int *key_len)
10931092
cwd_len = ZCG(cwd_key_len) = buf + sizeof(buf) - 1 - res;
10941093
cwd = ZCG(cwd_key);
10951094
memcpy(ZCG(cwd_key), res, cwd_len + 1);
1095+
} else {
1096+
return NULL;
10961097
}
1098+
} else {
1099+
return NULL;
10971100
}
10981101
}
10991102
}
@@ -1132,7 +1135,11 @@ char *accel_make_persistent_key(const char *path, int path_length, int *key_len)
11321135
include_path_len = ZCG(include_path_key_len) = buf + sizeof(buf) - 1 - res;
11331136
include_path = ZCG(include_path_key);
11341137
memcpy(ZCG(include_path_key), res, include_path_len + 1);
1138+
} else {
1139+
return NULL;
11351140
}
1141+
} else {
1142+
return NULL;
11361143
}
11371144
}
11381145
}
@@ -2179,6 +2186,7 @@ static void accel_reset_pcre_cache(void)
21792186
static void accel_activate(void)
21802187
{
21812188
if (!ZCG(enabled) || !accel_startup_ok) {
2189+
ZCG(accelerator_enabled) = 0;
21822190
return;
21832191
}
21842192

@@ -2206,6 +2214,7 @@ static void accel_activate(void)
22062214

22072215
#ifdef HAVE_OPCACHE_FILE_CACHE
22082216
if (file_cache_only) {
2217+
ZCG(accelerator_enabled) = 0;
22092218
return;
22102219
}
22112220
#endif

0 commit comments

Comments
 (0)