Skip to content

Commit bfadd9f

Browse files
committed
It's safe to keep old string if it's stored not in SHM.
1 parent ac12cc8 commit bfadd9f

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

ext/opcache/ZendAccelerator.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -572,10 +572,7 @@ static void accel_copy_permanent_strings(zend_new_interned_string_func_t new_int
572572
/* empty string */
573573
zend_empty_string = new_interned_string(zend_empty_string);
574574
for (j = 0; j < 256; j++) {
575-
char s[2];
576-
s[0] = j;
577-
s[1] = 0;
578-
zend_one_char_string[j] = new_interned_string(zend_string_init(s, 1, 0));
575+
zend_one_char_string[j] = new_interned_string(ZSTR_CHAR(j));
579576
}
580577
for (j = 0; j < ZEND_STR_LAST_KNOWN; j++) {
581578
zend_known_strings[j] = new_interned_string(zend_known_strings[j]);
@@ -739,12 +736,11 @@ static zend_string* ZEND_FASTCALL accel_replace_string_by_shm_permanent(zend_str
739736
static zend_string* ZEND_FASTCALL accel_replace_string_by_process_permanent(zend_string *str)
740737
{
741738
zend_string *ret = zend_interned_string_find_permanent(str);
742-
743739
if (ret) {
744740
zend_string_release(str);
745741
return ret;
746742
}
747-
ZEND_ASSERT(0);
743+
ZEND_ASSERT(!IS_ACCEL_INTERNED(str));
748744
return str;
749745
}
750746

0 commit comments

Comments
 (0)