diff options
author | Dmitry Stogov <dmitry@zend.com> | 2018-05-03 19:27:04 +0300 |
---|---|---|
committer | Dmitry Stogov <dmitry@zend.com> | 2018-05-03 19:27:04 +0300 |
commit | eafa92ba9d315106dede5aa154f81d0a4b34fe57 (patch) | |
tree | f41dd0d7576592548fe636034ed2986eb3bb62e0 | |
parent | fdb347a7539bde2c02b7efaae25583581c77b88e (diff) | |
download | php-git-eafa92ba9d315106dede5aa154f81d0a4b34fe57.tar.gz |
zend_fcall_info_cache.calling_scope is not used by zend_call_function() and doesn't have to be initialized.
It's used only as a result of zend_is_callable() in forward_static_call and spl_autoload.
-rw-r--r-- | Zend/zend_closures.c | 2 | ||||
-rw-r--r-- | Zend/zend_execute_API.c | 9 | ||||
-rw-r--r-- | Zend/zend_interfaces.c | 1 | ||||
-rw-r--r-- | ext/mysqli/mysqli.c | 1 | ||||
-rw-r--r-- | ext/pdo/pdo_dbh.c | 1 | ||||
-rw-r--r-- | ext/pdo/pdo_stmt.c | 1 | ||||
-rw-r--r-- | ext/pgsql/pgsql.c | 1 | ||||
-rw-r--r-- | ext/reflection/php_reflection.c | 6 | ||||
-rw-r--r-- | ext/spl/php_spl.c | 1 | ||||
-rw-r--r-- | ext/spl/spl_directory.c | 1 | ||||
-rw-r--r-- | ext/spl/spl_engine.h | 1 | ||||
-rw-r--r-- | main/streams/userspace.c | 1 |
12 files changed, 1 insertions, 25 deletions
diff --git a/Zend/zend_closures.c b/Zend/zend_closures.c index e3da91d8c1..3de41b5bef 100644 --- a/Zend/zend_closures.c +++ b/Zend/zend_closures.c @@ -152,7 +152,6 @@ ZEND_METHOD(Closure, call) } } - fci_cache.calling_scope = closure->called_scope; fci_cache.called_scope = newobj->ce; fci_cache.object = fci.object = newobj; @@ -250,7 +249,6 @@ static ZEND_NAMED_FUNCTION(zend_closure_call_magic) /* {{{ */ { fci.object = Z_OBJ(EX(This)); fcc.object = Z_OBJ(EX(This)); - fcc.calling_scope = zend_get_executed_scope(); zend_call_function(&fci, &fcc); diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c index 88eb4199a5..ab0459507c 100644 --- a/Zend/zend_execute_API.c +++ b/Zend/zend_execute_API.c @@ -646,13 +646,7 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache) / return FAILURE; /* we would result in an instable executor otherwise */ } - switch (fci->size) { - case sizeof(zend_fcall_info): - break; /* nothing to do currently */ - default: - zend_error_noreturn(E_CORE_ERROR, "Corrupted fcall_info provided to zend_call_function()"); - break; - } + ZEND_ASSERT(fci->size == sizeof(zend_fcall_info)); /* Initialize execute_data */ if (!EG(current_execute_data)) { @@ -954,7 +948,6 @@ ZEND_API zend_class_entry *zend_lookup_class_ex(zend_string *name, const zval *k fcall_info.no_separation = 1; fcall_cache.function_handler = EG(autoload_func); - fcall_cache.calling_scope = NULL; fcall_cache.called_scope = NULL; fcall_cache.object = NULL; diff --git a/Zend/zend_interfaces.c b/Zend/zend_interfaces.c index f47ddc7a27..78c9253442 100644 --- a/Zend/zend_interfaces.c +++ b/Zend/zend_interfaces.c @@ -81,7 +81,6 @@ ZEND_API zval* zend_call_method(zval *object, zend_class_entry *obj_ce, zend_fun fcic.function_handler = *fn_proxy; } - fcic.calling_scope = obj_ce; if (object) { fcic.called_scope = Z_OBJCE_P(object); } else { diff --git a/ext/mysqli/mysqli.c b/ext/mysqli/mysqli.c index 83e956ebdf..0c97ec33e8 100644 --- a/ext/mysqli/mysqli.c +++ b/ext/mysqli/mysqli.c @@ -1304,7 +1304,6 @@ void php_mysqli_fetch_into_hash(INTERNAL_FUNCTION_PARAMETERS, int override_flags } fcc.function_handler = ce->constructor; - fcc.calling_scope = zend_get_executed_scope(); fcc.called_scope = Z_OBJCE_P(return_value); fcc.object = Z_OBJ_P(return_value); diff --git a/ext/pdo/pdo_dbh.c b/ext/pdo/pdo_dbh.c index 5f6dc6cdc6..e78baea762 100644 --- a/ext/pdo/pdo_dbh.c +++ b/ext/pdo/pdo_dbh.c @@ -443,7 +443,6 @@ static void pdo_stmt_construct(zend_execute_data *execute_data, pdo_stmt_t *stmt zend_fcall_info_args(&fci, ctor_args); fcc.function_handler = dbstmt_ce->constructor; - fcc.calling_scope = zend_get_executed_scope(); fcc.called_scope = Z_OBJCE_P(object); fcc.object = Z_OBJ_P(object); diff --git a/ext/pdo/pdo_stmt.c b/ext/pdo/pdo_stmt.c index 777736095a..01c429c8ce 100644 --- a/ext/pdo/pdo_stmt.c +++ b/ext/pdo/pdo_stmt.c @@ -732,7 +732,6 @@ static int do_fetch_class_prepare(pdo_stmt_t *stmt) /* {{{ */ zend_fcall_info_args_ex(fci, ce->constructor, &stmt->fetch.cls.ctor_args); fcc->function_handler = ce->constructor; - fcc->calling_scope = zend_get_executed_scope(); fcc->called_scope = ce; return 1; } else if (!Z_ISUNDEF(stmt->fetch.cls.ctor_args)) { diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c index dccdfc2e9a..81a1bdbb3c 100644 --- a/ext/pgsql/pgsql.c +++ b/ext/pgsql/pgsql.c @@ -2831,7 +2831,6 @@ static void php_pgsql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, zend_long result_ } fcc.function_handler = ce->constructor; - fcc.calling_scope = zend_get_executed_scope(); fcc.called_scope = Z_OBJCE_P(return_value); fcc.object = Z_OBJ_P(return_value); diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index 42e4ee3c53..391183addf 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -1354,7 +1354,6 @@ static void _reflection_export(INTERNAL_FUNCTION_PARAMETERS, zend_class_entry *c fci.no_separation = 1; fcc.function_handler = ce_ptr->constructor; - fcc.calling_scope = ce_ptr; fcc.called_scope = Z_OBJCE(reflector); fcc.object = Z_OBJ(reflector); @@ -1880,7 +1879,6 @@ ZEND_METHOD(reflection_function, invoke) fci.no_separation = 1; fcc.function_handler = fptr; - fcc.calling_scope = zend_get_executed_scope(); fcc.called_scope = NULL; fcc.object = NULL; @@ -1940,7 +1938,6 @@ ZEND_METHOD(reflection_function, invokeArgs) fci.no_separation = 1; fcc.function_handler = fptr; - fcc.calling_scope = zend_get_executed_scope(); fcc.called_scope = NULL; fcc.object = NULL; @@ -3198,7 +3195,6 @@ static void reflection_method_invoke(INTERNAL_FUNCTION_PARAMETERS, int variadic) fci.no_separation = 1; fcc.function_handler = mptr; - fcc.calling_scope = obj_ce; fcc.called_scope = intern->ce; fcc.object = object ? Z_OBJ_P(object) : NULL; @@ -4758,7 +4754,6 @@ ZEND_METHOD(reflection_class, newInstance) fci.no_separation = 1; fcc.function_handler = constructor; - fcc.calling_scope = zend_get_executed_scope(); fcc.called_scope = Z_OBJCE_P(return_value); fcc.object = Z_OBJ_P(return_value); @@ -4859,7 +4854,6 @@ ZEND_METHOD(reflection_class, newInstanceArgs) fci.no_separation = 1; fcc.function_handler = constructor; - fcc.calling_scope = zend_get_executed_scope(); fcc.called_scope = Z_OBJCE_P(return_value); fcc.object = Z_OBJ_P(return_value); diff --git a/ext/spl/php_spl.c b/ext/spl/php_spl.c index 0c1f6c7b40..2ae1d0de9a 100644 --- a/ext/spl/php_spl.c +++ b/ext/spl/php_spl.c @@ -431,7 +431,6 @@ PHP_FUNCTION(spl_autoload_call) if (Z_ISUNDEF(alfi->obj)) { fci.object = NULL; fcic.object = NULL; - fcic.calling_scope = alfi->ce; if (alfi->ce && (!called_scope || !instanceof_function(called_scope, alfi->ce))) { diff --git a/ext/spl/spl_directory.c b/ext/spl/spl_directory.c index 9e21f8d5af..56e51dfe5b 100644 --- a/ext/spl/spl_directory.c +++ b/ext/spl/spl_directory.c @@ -2085,7 +2085,6 @@ static int spl_filesystem_file_call(spl_filesystem_object *intern, zend_function ZVAL_STR(&fci.function_name, func_ptr->common.function_name); fcic.function_handler = func_ptr; - fcic.calling_scope = NULL; fcic.called_scope = NULL; fcic.object = NULL; diff --git a/ext/spl/spl_engine.h b/ext/spl/spl_engine.h index cbfd644b46..9ff67a0cef 100644 --- a/ext/spl/spl_engine.h +++ b/ext/spl/spl_engine.h @@ -70,7 +70,6 @@ static inline void spl_instantiate_arg_n(zend_class_entry *pce, zval *retval, in fci.no_separation = 1; fcc.function_handler = func; - fcc.calling_scope = zend_get_executed_scope(); fcc.called_scope = pce; fcc.object = Z_OBJ_P(retval); diff --git a/main/streams/userspace.c b/main/streams/userspace.c index d73fb898f8..fedcc3f8bb 100644 --- a/main/streams/userspace.c +++ b/main/streams/userspace.c @@ -312,7 +312,6 @@ static void user_stream_create_object(struct php_user_stream_wrapper *uwrap, php fci.no_separation = 1; fcc.function_handler = uwrap->ce->constructor; - fcc.calling_scope = zend_get_executed_scope(); fcc.called_scope = Z_OBJCE_P(object); fcc.object = Z_OBJ_P(object); |