@@ -439,7 +439,7 @@ static zend_always_inline zend_string *accel_find_interned_string(zend_string *s
439
439
440
440
if (!ZCG (counted )) {
441
441
if (!ZCG (accelerator_enabled ) || accel_activate_add () == FAILURE ) {
442
- return str ;
442
+ return NULL ;
443
443
}
444
444
ZCG (counted ) = 1 ;
445
445
}
@@ -747,10 +747,9 @@ static void accel_use_shm_interned_strings(void)
747
747
if (ZCSG (interned_strings ).saved_top == NULL ) {
748
748
accel_copy_permanent_strings (accel_new_interned_string );
749
749
} else {
750
+ ZCG (counted ) = 1 ;
750
751
accel_copy_permanent_strings (accel_replace_string_by_shm_permanent );
751
- if (ZCG (counted )) {
752
- accel_deactivate_sub ();
753
- }
752
+ ZCG (counted ) = 0 ;
754
753
}
755
754
accel_interned_strings_save_state ();
756
755
@@ -1177,7 +1176,11 @@ char *accel_make_persistent_key(const char *path, size_t path_length, int *key_l
1177
1176
cwd_len = ZCG (cwd_key_len ) = buf + sizeof (buf ) - 1 - res ;
1178
1177
cwd = ZCG (cwd_key );
1179
1178
memcpy (ZCG (cwd_key ), res , cwd_len + 1 );
1179
+ } else {
1180
+ return NULL ;
1180
1181
}
1182
+ } else {
1183
+ return NULL ;
1181
1184
}
1182
1185
}
1183
1186
}
@@ -1216,7 +1219,11 @@ char *accel_make_persistent_key(const char *path, size_t path_length, int *key_l
1216
1219
include_path_len = ZCG (include_path_key_len ) = buf + sizeof (buf ) - 1 - res ;
1217
1220
include_path = ZCG (include_path_key );
1218
1221
memcpy (ZCG (include_path_key ), res , include_path_len + 1 );
1222
+ } else {
1223
+ return NULL ;
1219
1224
}
1225
+ } else {
1226
+ return NULL ;
1220
1227
}
1221
1228
}
1222
1229
}
@@ -2290,6 +2297,7 @@ static void accel_reset_pcre_cache(void)
2290
2297
int accel_activate (INIT_FUNC_ARGS )
2291
2298
{
2292
2299
if (!ZCG (enabled ) || !accel_startup_ok ) {
2300
+ ZCG (accelerator_enabled ) = 0 ;
2293
2301
return SUCCESS ;
2294
2302
}
2295
2303
@@ -2306,6 +2314,7 @@ int accel_activate(INIT_FUNC_ARGS)
2306
2314
ZCG (cwd_check ) = 1 ;
2307
2315
2308
2316
if (file_cache_only ) {
2317
+ ZCG (accelerator_enabled ) = 0 ;
2309
2318
return SUCCESS ;
2310
2319
}
2311
2320
0 commit comments