Skip to content

Commit 96a6f7f

Browse files
committed
Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2: Backport 96a1257
2 parents a5b39ab + 28808ca commit 96a6f7f

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
@@ -432,7 +432,7 @@ static zend_always_inline zend_string *accel_find_interned_string(zend_string *s
432432

433433
if (!ZCG(counted)) {
434434
if (!ZCG(accelerator_enabled) || accel_activate_add() == FAILURE) {
435-
return str;
435+
return NULL;
436436
}
437437
ZCG(counted) = 1;
438438
}
@@ -754,10 +754,9 @@ static void accel_use_shm_interned_strings(void)
754754
if (ZCSG(interned_strings).saved_top == NULL) {
755755
accel_copy_permanent_strings(accel_new_interned_string);
756756
} else {
757+
ZCG(counted) = 1;
757758
accel_copy_permanent_strings(accel_replace_string_by_shm_permanent);
758-
if (ZCG(counted)) {
759-
accel_deactivate_sub();
760-
}
759+
ZCG(counted) = 0;
761760
}
762761
accel_interned_strings_save_state();
763762

@@ -1187,7 +1186,11 @@ char *accel_make_persistent_key(const char *path, size_t path_length, int *key_l
11871186
cwd_len = ZCG(cwd_key_len) = buf + sizeof(buf) - 1 - res;
11881187
cwd = ZCG(cwd_key);
11891188
memcpy(ZCG(cwd_key), res, cwd_len + 1);
1189+
} else {
1190+
return NULL;
11901191
}
1192+
} else {
1193+
return NULL;
11911194
}
11921195
}
11931196
}
@@ -1226,7 +1229,11 @@ char *accel_make_persistent_key(const char *path, size_t path_length, int *key_l
12261229
include_path_len = ZCG(include_path_key_len) = buf + sizeof(buf) - 1 - res;
12271230
include_path = ZCG(include_path_key);
12281231
memcpy(ZCG(include_path_key), res, include_path_len + 1);
1232+
} else {
1233+
return NULL;
12291234
}
1235+
} else {
1236+
return NULL;
12301237
}
12311238
}
12321239
}
@@ -2325,6 +2332,7 @@ static void accel_reset_pcre_cache(void)
23252332
static void accel_activate(void)
23262333
{
23272334
if (!ZCG(enabled) || !accel_startup_ok) {
2335+
ZCG(accelerator_enabled) = 0;
23282336
return;
23292337
}
23302338

@@ -2352,6 +2360,7 @@ static void accel_activate(void)
23522360

23532361
#ifdef HAVE_OPCACHE_FILE_CACHE
23542362
if (file_cache_only) {
2363+
ZCG(accelerator_enabled) = 0;
23552364
return;
23562365
}
23572366
#endif

0 commit comments

Comments
 (0)