Skip to content

Commit 3a46f9f

Browse files
committed
Intern string values of internal classes to prevent their future interning during inheritance.
1 parent 20d1d23 commit 3a46f9f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

ext/opcache/ZendAccelerator.c

+6
Original file line numberDiff line numberDiff line change
@@ -668,9 +668,15 @@ static void accel_copy_permanent_strings(zend_new_interned_string_func_t new_int
668668
} ZEND_HASH_FOREACH_END();
669669

670670
ZEND_HASH_FOREACH_BUCKET(&ce->constants_table, q) {
671+
zend_class_constant* c;
672+
671673
if (q->key) {
672674
q->key = new_interned_string(q->key);
673675
}
676+
c = (zend_class_constant*)Z_PTR(q->val);
677+
if (Z_TYPE(c->value) == IS_STRING) {
678+
ZVAL_STR(&c->value, new_interned_string(Z_STR(c->value)));
679+
}
674680
} ZEND_HASH_FOREACH_END();
675681
} ZEND_HASH_FOREACH_END();
676682

0 commit comments

Comments
 (0)