mirror of
https://github.com/php/php-src.git
synced 2024-09-21 18:07:23 +00:00
Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2: Fixed incorrect ZEND_ACC_ARENA_ALLOCATED usage (it must be used only for internal functions).
This commit is contained in:
commit
566a75e97c
@ -1250,10 +1250,15 @@ static void zend_add_trait_method(zend_class_entry *ce, const char *name, zend_s
|
||||
}
|
||||
}
|
||||
|
||||
function_add_ref(fn);
|
||||
new_fn = zend_arena_alloc(&CG(arena), sizeof(zend_op_array));
|
||||
memcpy(new_fn, fn, sizeof(zend_op_array));
|
||||
new_fn->common.fn_flags |= ZEND_ACC_ARENA_ALLOCATED;
|
||||
if (UNEXPECTED(fn->type == ZEND_INTERNAL_FUNCTION)) {
|
||||
new_fn = zend_arena_alloc(&CG(arena), sizeof(zend_internal_function));
|
||||
memcpy(new_fn, fn, sizeof(zend_internal_function));
|
||||
new_fn->common.fn_flags |= ZEND_ACC_ARENA_ALLOCATED;
|
||||
} else {
|
||||
function_add_ref(fn);
|
||||
new_fn = zend_arena_alloc(&CG(arena), sizeof(zend_op_array));
|
||||
memcpy(new_fn, fn, sizeof(zend_op_array));
|
||||
}
|
||||
fn = zend_hash_update_ptr(&ce->function_table, key, new_fn);
|
||||
zend_add_magic_methods(ce, key, fn);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user