Skip to content

Commit eb6e2c5

Browse files
committed
Merge branch 'master' into preload
* master: Call function_add_ref() in proper place Updated to version 2018.7 (2018g) Updated to version 2018.7 (2018g) Updated to version 2018.7 (2018g) Reslove inherited op_array references once afrer all optimizations.
2 parents 5620495 + 2fefa8c commit eb6e2c5

File tree

3 files changed

+31141
-31564
lines changed

3 files changed

+31141
-31564
lines changed

Zend/zend_inheritance.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1301,7 +1301,6 @@ static void zend_add_trait_method(zend_class_entry *ce, const char *name, zend_s
13011301
}
13021302
}
13031303

1304-
function_add_ref(fn);
13051304
if (UNEXPECTED(fn->type == ZEND_INTERNAL_FUNCTION)) {
13061305
new_fn = zend_arena_alloc(&CG(arena), sizeof(zend_internal_function));
13071306
memcpy(new_fn, fn, sizeof(zend_internal_function));
@@ -1310,10 +1309,8 @@ static void zend_add_trait_method(zend_class_entry *ce, const char *name, zend_s
13101309
new_fn = zend_arena_alloc(&CG(arena), sizeof(zend_op_array));
13111310
memcpy(new_fn, fn, sizeof(zend_op_array));
13121311
new_fn->op_array.fn_flags &= ~ZEND_ACC_IMMUTABLE;
1313-
ZEND_MAP_PTR_INIT(new_fn->op_array.run_time_cache, zend_arena_alloc(&CG(arena), sizeof(void*)));
1314-
ZEND_MAP_PTR_SET(new_fn->op_array.run_time_cache, NULL);
1315-
ZEND_MAP_PTR_INIT(new_fn->op_array.static_variables_ptr, &new_fn->op_array.static_variables);
13161312
}
1313+
function_add_ref(new_fn);
13171314
fn = zend_hash_update_ptr(&ce->function_table, key, new_fn);
13181315
zend_add_magic_methods(ce, key, fn);
13191316
}

0 commit comments

Comments
 (0)