File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -2634,7 +2634,9 @@ static int zend_accel_init_shm(void)
2634
2634
if (ZCG (accel_directives ).interned_strings_buffer ) {
2635
2635
accel_shared_globals = zend_shared_alloc ((ZCG (accel_directives ).interned_strings_buffer * 1024 * 1024 ));
2636
2636
} else {
2637
- accel_shared_globals = zend_shared_alloc (sizeof (zend_accel_shared_globals ));
2637
+ /* Make sure there is always at least one interned string hash slot,
2638
+ * so the table can be queried unconditionally. */
2639
+ accel_shared_globals = zend_shared_alloc (sizeof (zend_accel_shared_globals ) + sizeof (uint32_t ));
2638
2640
}
2639
2641
if (!accel_shared_globals ) {
2640
2642
zend_accel_error (ACCEL_LOG_FATAL , "Insufficient shared memory!" );
@@ -2675,6 +2677,8 @@ static int zend_accel_init_shm(void)
2675
2677
STRTAB_INVALID_POS ,
2676
2678
(char * )ZCSG (interned_strings ).start -
2677
2679
((char * )& ZCSG (interned_strings ) + sizeof (zend_string_table )));
2680
+ } else {
2681
+ * STRTAB_HASH_TO_SLOT (& ZCSG (interned_strings ), 0 ) = STRTAB_INVALID_POS ;
2678
2682
}
2679
2683
2680
2684
zend_interned_strings_set_request_storage_handlers (accel_new_interned_string_for_php , accel_init_interned_string_for_php );
You can’t perform that action at this time.
0 commit comments