diff options
| author | Dmitry Stogov <dmitry@zend.com> | 2021-02-18 15:46:48 +0300 |
|---|---|---|
| committer | Dmitry Stogov <dmitry@zend.com> | 2021-02-18 15:46:48 +0300 |
| commit | 6e988eaefb41e781f2e0c84e478e56e57d181908 (patch) | |
| tree | 43853e40fd0bac96e460332694c8781e0068774a | |
| parent | 4f4c031f62e28ed53869a57264535a8739a010e9 (diff) | |
| download | php-git-6e988eaefb41e781f2e0c84e478e56e57d181908.tar.gz | |
We don't need map_ptr slots for op_array.run_time_cache during preloading.
| -rw-r--r-- | Zend/zend_compile.c | 16 |
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; |
