@@ -413,7 +413,7 @@ static zend_string *accel_find_interned_string(zend_string *str)
413
413
414
414
if (!ZCG (counted )) {
415
415
if (!ZCG (accelerator_enabled ) || accel_activate_add () == FAILURE ) {
416
- return str ;
416
+ return NULL ;
417
417
}
418
418
ZCG (counted ) = 1 ;
419
419
}
@@ -658,10 +658,9 @@ static void accel_use_shm_interned_strings(void)
658
658
if (ZCSG (interned_strings_saved_top ) == NULL ) {
659
659
accel_copy_permanent_strings (accel_new_interned_string );
660
660
} else {
661
+ ZCG (counted ) = 1 ;
661
662
accel_copy_permanent_strings (accel_replace_string_by_shm_permanent );
662
- if (ZCG (counted )) {
663
- accel_deactivate_sub ();
664
- }
663
+ ZCG (counted ) = 0 ;
665
664
}
666
665
accel_interned_strings_save_state ();
667
666
@@ -1093,7 +1092,11 @@ char *accel_make_persistent_key(const char *path, int path_length, int *key_len)
1093
1092
cwd_len = ZCG (cwd_key_len ) = buf + sizeof (buf ) - 1 - res ;
1094
1093
cwd = ZCG (cwd_key );
1095
1094
memcpy (ZCG (cwd_key ), res , cwd_len + 1 );
1095
+ } else {
1096
+ return NULL ;
1096
1097
}
1098
+ } else {
1099
+ return NULL ;
1097
1100
}
1098
1101
}
1099
1102
}
@@ -1132,7 +1135,11 @@ char *accel_make_persistent_key(const char *path, int path_length, int *key_len)
1132
1135
include_path_len = ZCG (include_path_key_len ) = buf + sizeof (buf ) - 1 - res ;
1133
1136
include_path = ZCG (include_path_key );
1134
1137
memcpy (ZCG (include_path_key ), res , include_path_len + 1 );
1138
+ } else {
1139
+ return NULL ;
1135
1140
}
1141
+ } else {
1142
+ return NULL ;
1136
1143
}
1137
1144
}
1138
1145
}
@@ -2179,6 +2186,7 @@ static void accel_reset_pcre_cache(void)
2179
2186
static void accel_activate (void )
2180
2187
{
2181
2188
if (!ZCG (enabled ) || !accel_startup_ok ) {
2189
+ ZCG (accelerator_enabled ) = 0 ;
2182
2190
return ;
2183
2191
}
2184
2192
@@ -2206,6 +2214,7 @@ static void accel_activate(void)
2206
2214
2207
2215
#ifdef HAVE_OPCACHE_FILE_CACHE
2208
2216
if (file_cache_only ) {
2217
+ ZCG (accelerator_enabled ) = 0 ;
2209
2218
return ;
2210
2219
}
2211
2220
#endif
0 commit comments