Skip to content

Commit d399f3e

Browse files
committed
Adjust Zend Accelerator
No test as stub support to add a test case needs support in PHP-Parser
1 parent 5a292c6 commit d399f3e

File tree

1 file changed

+16
-7
lines changed

1 file changed

+16
-7
lines changed

ext/opcache/ZendAccelerator.c

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -616,6 +616,21 @@ static zend_string* ZEND_FASTCALL accel_init_interned_string_for_php(const char
616616
return zend_string_init(str, size, permanent);
617617
}
618618

619+
static inline void accel_copy_permanent_list_types(
620+
zend_new_interned_string_func_t new_interned_string, zend_type type)
621+
{
622+
zend_type *single_type;
623+
ZEND_TYPE_FOREACH(type, single_type) {
624+
if (ZEND_TYPE_HAS_LIST(*single_type)) {
625+
ZEND_ASSERT(ZEND_TYPE_IS_INTERSECTION(*single_type));
626+
accel_copy_permanent_list_types(new_interned_string, *single_type);
627+
}
628+
if (ZEND_TYPE_HAS_NAME(*single_type)) {
629+
ZEND_TYPE_SET_PTR(*single_type, new_interned_string(ZEND_TYPE_NAME(*single_type)));
630+
}
631+
} ZEND_TYPE_FOREACH_END();
632+
}
633+
619634
/* Copy PHP interned strings from PHP process memory into the shared memory */
620635
static void accel_copy_permanent_strings(zend_new_interned_string_func_t new_interned_string)
621636
{
@@ -650,13 +665,7 @@ static void accel_copy_permanent_strings(zend_new_interned_string_func_t new_int
650665
num_args++;
651666
}
652667
for (i = 0 ; i < num_args; i++) {
653-
zend_type *single_type;
654-
ZEND_TYPE_FOREACH(arg_info[i].type, single_type) {
655-
if (ZEND_TYPE_HAS_NAME(*single_type)) {
656-
ZEND_TYPE_SET_PTR(*single_type,
657-
new_interned_string(ZEND_TYPE_NAME(*single_type)));
658-
}
659-
} ZEND_TYPE_FOREACH_END();
668+
accel_copy_permanent_list_types(new_interned_string, arg_info[i].type);
660669
}
661670
}
662671
} ZEND_HASH_FOREACH_END();

0 commit comments

Comments
 (0)