summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Zend/zend_compile.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c
index d76b8f74ec..07c4e87621 100644
--- a/Zend/zend_compile.c
+++ b/Zend/zend_compile.c
@@ -1046,13 +1046,8 @@ ZEND_API void function_add_ref(zend_function *function) /* {{{ */
(*op_array->refcount)++;
}
- if (CG(compiler_options) & ZEND_COMPILE_PRELOAD) {
- ZEND_ASSERT(op_array->fn_flags & ZEND_ACC_PRELOADED);
- ZEND_MAP_PTR_NEW(op_array->run_time_cache);
- } else {
- ZEND_MAP_PTR_INIT(op_array->run_time_cache, zend_arena_alloc(&CG(arena), sizeof(void *)));
- ZEND_MAP_PTR_SET(op_array->run_time_cache, NULL);
- }
+ ZEND_MAP_PTR_INIT(op_array->run_time_cache, zend_arena_alloc(&CG(arena), sizeof(void *)));
+ ZEND_MAP_PTR_SET(op_array->run_time_cache, NULL);
zend_init_static_variables_map_ptr(op_array);
}
@@ -7024,12 +7019,11 @@ void zend_compile_func_decl(znode *result, zend_ast *ast, bool toplevel) /* {{{
if (CG(compiler_options) & ZEND_COMPILE_PRELOAD) {
op_array->fn_flags |= ZEND_ACC_PRELOADED;
- ZEND_MAP_PTR_NEW(op_array->run_time_cache);
- } else {
- ZEND_MAP_PTR_INIT(op_array->run_time_cache, zend_arena_alloc(&CG(arena), sizeof(void *)));
- ZEND_MAP_PTR_SET(op_array->run_time_cache, NULL);
}
+ ZEND_MAP_PTR_INIT(op_array->run_time_cache, zend_arena_alloc(&CG(arena), sizeof(void *)));
+ ZEND_MAP_PTR_SET(op_array->run_time_cache, NULL);
+
op_array->fn_flags |= (orig_op_array->fn_flags & ZEND_ACC_STRICT_TYPES);
op_array->fn_flags |= decl->flags;
op_array->line_start = decl->start_lineno;