mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
Fexed resolution of method clones
This commit is contained in:
parent
aea85c65bd
commit
3a9d90f74a
2 changed files with 13 additions and 7 deletions
|
@ -1561,10 +1561,12 @@ int zend_optimize_script(zend_script *script, zend_long optimization_level, zend
|
|||
|
||||
ZEND_ASSERT(orig_op_array != NULL);
|
||||
if (orig_op_array != op_array) {
|
||||
uint32_t fn_flags = op_array->fn_flags;
|
||||
zend_function *prototype = op_array->prototype;
|
||||
HashTable *ht = op_array->static_variables;
|
||||
|
||||
*op_array = *orig_op_array;
|
||||
op_array->fn_flags = fn_flags;
|
||||
op_array->prototype = prototype;
|
||||
op_array->static_variables = ht;
|
||||
}
|
||||
|
|
|
@ -3558,14 +3558,18 @@ static int preload_optimize(zend_persistent_script *script)
|
|||
ZEND_HASH_FOREACH_PTR(&ce->function_table, op_array) {
|
||||
if (op_array->fn_flags & ZEND_ACC_TRAIT_CLONE) {
|
||||
zend_op_array *orig_op_array = zend_shared_alloc_get_xlat_entry(op_array->opcodes);
|
||||
if (orig_op_array) {
|
||||
zend_class_entry *scope = op_array->scope;
|
||||
uint32_t fn_flags = op_array->fn_flags;
|
||||
zend_function *prototype = op_array->prototype;
|
||||
HashTable *ht = op_array->static_variables;
|
||||
*op_array = *orig_op_array;
|
||||
op_array->scope = scope;
|
||||
op_array->fn_flags = fn_flags;
|
||||
op_array->prototype = prototype;
|
||||
op_array->static_variables = ht;
|
||||
}
|
||||
}
|
||||
} ZEND_HASH_FOREACH_END();
|
||||
}
|
||||
} ZEND_HASH_FOREACH_END();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue