Skip to content

Commit 6e988ea

Browse files
committed
We don't need map_ptr slots for op_array.run_time_cache during preloading.
1 parent 4f4c031 commit 6e988ea

File tree

1 file changed

+5
-11
lines changed

1 file changed

+5
-11
lines changed

Zend/zend_compile.c

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1046,13 +1046,8 @@ ZEND_API void function_add_ref(zend_function *function) /* {{{ */
10461046
(*op_array->refcount)++;
10471047
}
10481048

1049-
if (CG(compiler_options) & ZEND_COMPILE_PRELOAD) {
1050-
ZEND_ASSERT(op_array->fn_flags & ZEND_ACC_PRELOADED);
1051-
ZEND_MAP_PTR_NEW(op_array->run_time_cache);
1052-
} else {
1053-
ZEND_MAP_PTR_INIT(op_array->run_time_cache, zend_arena_alloc(&CG(arena), sizeof(void *)));
1054-
ZEND_MAP_PTR_SET(op_array->run_time_cache, NULL);
1055-
}
1049+
ZEND_MAP_PTR_INIT(op_array->run_time_cache, zend_arena_alloc(&CG(arena), sizeof(void *)));
1050+
ZEND_MAP_PTR_SET(op_array->run_time_cache, NULL);
10561051

10571052
zend_init_static_variables_map_ptr(op_array);
10581053
}
@@ -7024,12 +7019,11 @@ void zend_compile_func_decl(znode *result, zend_ast *ast, bool toplevel) /* {{{
70247019

70257020
if (CG(compiler_options) & ZEND_COMPILE_PRELOAD) {
70267021
op_array->fn_flags |= ZEND_ACC_PRELOADED;
7027-
ZEND_MAP_PTR_NEW(op_array->run_time_cache);
7028-
} else {
7029-
ZEND_MAP_PTR_INIT(op_array->run_time_cache, zend_arena_alloc(&CG(arena), sizeof(void *)));
7030-
ZEND_MAP_PTR_SET(op_array->run_time_cache, NULL);
70317022
}
70327023

7024+
ZEND_MAP_PTR_INIT(op_array->run_time_cache, zend_arena_alloc(&CG(arena), sizeof(void *)));
7025+
ZEND_MAP_PTR_SET(op_array->run_time_cache, NULL);
7026+
70337027
op_array->fn_flags |= (orig_op_array->fn_flags & ZEND_ACC_STRICT_TYPES);
70347028
op_array->fn_flags |= decl->flags;
70357029
op_array->line_start = decl->start_lineno;

0 commit comments

Comments
 (0)