]> granicus.if.org Git - php/commitdiff
Removed "zend_fcall_info.function_table". It was assigned in many places, but is...
authorDmitry Stogov <dmitry@zend.com>
Wed, 27 Apr 2016 10:46:38 +0000 (13:46 +0300)
committerDmitry Stogov <dmitry@zend.com>
Wed, 27 Apr 2016 10:46:38 +0000 (13:46 +0300)
21 files changed:
Zend/zend_API.c
Zend/zend_API.h
Zend/zend_exceptions.c
Zend/zend_execute_API.c
Zend/zend_interfaces.c
ext/curl/interface.c
ext/dom/xpath.c
ext/mysqli/mysqli.c
ext/pdo/pdo_dbh.c
ext/pdo/pdo_stmt.c
ext/pdo_sqlite/sqlite_driver.c
ext/pgsql/pgsql.c
ext/reflection/php_reflection.c
ext/soap/soap.c
ext/spl/spl_directory.c
ext/spl/spl_engine.h
ext/sqlite3/sqlite3.c
ext/xml/xml.c
ext/xsl/xsltprocessor.c
main/streams/userspace.c
sapi/phpdbg/phpdbg_prompt.c

index 18e6e0f4f4a2e285d62069ad54f9edeecb9a90ce..fdb9628dbf1608419cca0140c8f064ffe4b6f032 100644 (file)
@@ -3412,7 +3412,6 @@ ZEND_API int zend_fcall_info_init(zval *callable, uint check_flags, zend_fcall_i
        }
 
        fci->size = sizeof(*fci);
-       fci->function_table = fcc->calling_scope ? &fcc->calling_scope->function_table : EG(function_table);
        fci->object = fcc->object;
        ZVAL_COPY_VALUE(&fci->function_name, callable);
        fci->retval = NULL;
index 07b48365f33b41e30c1772d3727f3884548a95e7..cc54a90867d17a7bb4d251d1f66406530245f758 100644 (file)
@@ -43,7 +43,6 @@ typedef struct _zend_function_entry {
 
 typedef struct _zend_fcall_info {
        size_t size;
-       HashTable *function_table;
        zval function_name;
        zval *retval;
        zval *params;
@@ -468,11 +467,12 @@ ZEND_API int add_property_zval_ex(zval *arg, const char *key, size_t key_len, zv
 #define add_property_zval(__arg, __key, __value) add_property_zval_ex(__arg, __key, strlen(__key), __value)
 
 
-ZEND_API int call_user_function(HashTable *function_table, zval *object, zval *function_name, zval *retval_ptr, uint32_t param_count, zval params[]);
-ZEND_API int _call_user_function_ex(HashTable *function_table, zval *object, zval *function_name, zval *retval_ptr, uint32_t param_count, zval params[], int no_separation);
+ZEND_API int _call_user_function_ex(zval *object, zval *function_name, zval *retval_ptr, uint32_t param_count, zval params[], int no_separation);
 
+#define call_user_function(function_table, object, function_name, retval_ptr, param_count, params) \
+       _call_user_function_ex(object, function_name, retval_ptr, param_count, params, 1)
 #define call_user_function_ex(function_table, object, function_name, retval_ptr, param_count, params, no_separation, symbol_table) \
-       _call_user_function_ex(function_table, object, function_name, retval_ptr, param_count, params, no_separation)
+       _call_user_function_ex(object, function_name, retval_ptr, param_count, params, no_separation)
 
 ZEND_API extern const zend_fcall_info empty_fcall_info;
 ZEND_API extern const zend_fcall_info_cache empty_fcall_info_cache;
index 6d396e7854bc85383bbabbf33a4ef9dbc7d385a7..f7081327f0c137326e5e60cc610fed464fa69461 100644 (file)
@@ -678,7 +678,6 @@ ZEND_METHOD(exception, __toString)
                zend_long line = zval_get_long(GET_PROPERTY(exception, "line"));
 
                fci.size = sizeof(fci);
-               fci.function_table = &Z_OBJCE_P(exception)->function_table;
                ZVAL_COPY_VALUE(&fci.function_name, &fname);
                fci.object = Z_OBJ_P(exception);
                fci.retval = &trace;
index f1abd801d1c147e72712ec045dac19a458aae2b5..63d20e1fe24fa822c1fdf8471876969fd73a5f19 100644 (file)
@@ -46,7 +46,7 @@ ZEND_API void (*zend_execute_ex)(zend_execute_data *execute_data);
 ZEND_API void (*zend_execute_internal)(zend_execute_data *execute_data, zval *return_value);
 
 /* true globals */
-ZEND_API const zend_fcall_info empty_fcall_info = { 0, NULL, {{0}, {{0}}, {0}}, NULL, NULL, NULL, 0, 0 };
+ZEND_API const zend_fcall_info empty_fcall_info = { 0, {{0}, {{0}}, {0}}, NULL, NULL, NULL, 0, 0 };
 ZEND_API const zend_fcall_info_cache empty_fcall_info_cache = { 0, NULL, NULL, NULL, NULL };
 
 #ifdef ZEND_WIN32
@@ -663,18 +663,11 @@ ZEND_API int zval_update_constant(zval *pp, zend_bool inline_change) /* {{{ */
 }
 /* }}} */
 
-int call_user_function(HashTable *function_table, zval *object, zval *function_name, zval *retval_ptr, uint32_t param_count, zval params[]) /* {{{ */
-{
-       return call_user_function_ex(function_table, object, function_name, retval_ptr, param_count, params, 1, NULL);
-}
-/* }}} */
-
-int _call_user_function_ex(HashTable *function_table, zval *object, zval *function_name, zval *retval_ptr, uint32_t param_count, zval params[], int no_separation) /* {{{ */
+int _call_user_function_ex(zval *object, zval *function_name, zval *retval_ptr, uint32_t param_count, zval params[], int no_separation) /* {{{ */
 {
        zend_fcall_info fci;
 
        fci.size = sizeof(fci);
-       fci.function_table = function_table;
        fci.object = object ? Z_OBJ_P(object) : NULL;
        ZVAL_COPY_VALUE(&fci.function_name, function_name);
        fci.retval = retval_ptr;
@@ -1023,7 +1016,6 @@ ZEND_API zend_class_entry *zend_lookup_class_ex(zend_string *name, const zval *k
        }
 
        fcall_info.size = sizeof(fcall_info);
-       fcall_info.function_table = EG(function_table);
        ZVAL_STR_COPY(&fcall_info.function_name, EG(autoload_func)->common.function_name);
        fcall_info.retval = &local_retval;
        fcall_info.param_count = 1;
index c7d225704f06643b3a1aa7765fff448cf5cefe64..2dadb39b177b3326b362fbbf74639572e3e1a168 100644 (file)
@@ -59,7 +59,6 @@ ZEND_API zval* zend_call_method(zval *object, zend_class_entry *obj_ce, zend_fun
        if (!fn_proxy && !obj_ce) {
                /* no interest in caching and no information already present that is
                 * needed later inside zend_call_function. */
-               fci.function_table = !object ? EG(function_table) : NULL;
                result = zend_call_function(&fci, NULL);
                zval_ptr_dtor(&fci.function_name);
        } else {
index 4e0b321de0d872d3a70ab1e8e6d190766824e62d..53d76a076ca03ae99a870d496a242a2927daa5f1 100644 (file)
@@ -1342,7 +1342,6 @@ static size_t curl_write(char *data, size_t size, size_t nmemb, void *ctx)
                        ZVAL_STRINGL(&argv[1], data, length);
 
                        fci.size = sizeof(fci);
-                       fci.function_table = EG(function_table);
                        fci.object = NULL;
                        ZVAL_COPY_VALUE(&fci.function_name, &t->func_name);
                        fci.retval = &retval;
@@ -1392,7 +1391,6 @@ static int curl_fnmatch(void *ctx, const char *pattern, const char *string)
                        ZVAL_STRING(&argv[2], string);
 
                        fci.size = sizeof(fci);
-                       fci.function_table = EG(function_table);
                        ZVAL_COPY_VALUE(&fci.function_name, &t->func_name);
                        fci.object = NULL;
                        fci.retval = &retval;
@@ -1448,7 +1446,6 @@ static size_t curl_progress(void *clientp, double dltotal, double dlnow, double
                        ZVAL_LONG(&argv[4], (zend_long)ulnow);
 
                        fci.size = sizeof(fci);
-                       fci.function_table = EG(function_table);
                        ZVAL_COPY_VALUE(&fci.function_name, &t->func_name);
                        fci.object = NULL;
                        fci.retval = &retval;
@@ -1510,7 +1507,6 @@ static size_t curl_read(char *data, size_t size, size_t nmemb, void *ctx)
                        ZVAL_LONG(&argv[2], (int)size * nmemb);
 
                        fci.size = sizeof(fci);
-                       fci.function_table = EG(function_table);
                        ZVAL_COPY_VALUE(&fci.function_name, &t->func_name);
                        fci.object = NULL;
                        fci.retval = &retval;
@@ -1577,7 +1573,6 @@ static size_t curl_write_header(char *data, size_t size, size_t nmemb, void *ctx
                        ZVAL_STRINGL(&argv[1], data, length);
 
                        fci.size = sizeof(fci);
-                       fci.function_table = EG(function_table);
                        ZVAL_COPY_VALUE(&fci.function_name, &t->func_name);
                        fci.object = NULL;
                        fci.retval = &retval;
index 3cc9abaa3c67a82ca79ebc598d818a86b4058080..e31dcefb7862bc0ccb632729f226d97631485fc6 100644 (file)
@@ -171,7 +171,6 @@ static void dom_xpath_ext_function_php(xmlXPathParserContextPtr ctxt, int nargs,
        }
 
        fci.size = sizeof(fci);
-       fci.function_table = EG(function_table);
 
        obj = valuePop(ctxt);
        if (obj->stringval == NULL) {
index 7d971c1b99dbe60a7fdc096db20a926730b47d6e..e339e85d34dd3f57b370c82e57bc353a663f5749 100644 (file)
@@ -1282,7 +1282,6 @@ void php_mysqli_fetch_into_hash(INTERNAL_FUNCTION_PARAMETERS, int override_flags
 
                if (ce->constructor) {
                        fci.size = sizeof(fci);
-                       fci.function_table = &ce->function_table;
                        ZVAL_UNDEF(&fci.function_name);
                        fci.object = Z_OBJ_P(return_value);
                        fci.retval = &retval;
index 1d77f3e0eb40f8096dd04afa27cd149840b5a496..68c9d67a6af5d2889c5356b946ddc1f7181aabd0 100644 (file)
@@ -436,7 +436,6 @@ static void pdo_stmt_construct(zend_execute_data *execute_data, pdo_stmt_t *stmt
                zval retval;
 
                fci.size = sizeof(zend_fcall_info);
-               fci.function_table = &dbstmt_ce->function_table;
                ZVAL_UNDEF(&fci.function_name);
                fci.object = Z_OBJ_P(object);
                fci.retval = &retval;
index da557b85973d710775f6fb66ea250b0ef567b602..91546c02c503cf1159a918a9ff556b0165690b25 100644 (file)
@@ -740,7 +740,6 @@ static int do_fetch_class_prepare(pdo_stmt_t *stmt) /* {{{ */
        }
 
        if (ce->constructor) {
-               fci->function_table = &ce->function_table;
                ZVAL_UNDEF(&fci->function_name);
                fci->retval = &stmt->fetch.cls.retval;
                fci->param_count = 0;
index 8c732b9dbe3842b95ade4491ef50cfe71e579b64..4e729aab0e15a0ff6433da60286b09fcc04229b3 100644 (file)
@@ -325,7 +325,6 @@ static int do_callback(struct pdo_sqlite_fci *fc, zval *cb,
        fake_argc = argc + is_agg;
 
        fc->fci.size = sizeof(fc->fci);
-       fc->fci.function_table = EG(function_table);
        ZVAL_COPY_VALUE(&fc->fci.function_name, cb);
        fc->fci.object = NULL;
        fc->fci.retval = &retval;
@@ -475,7 +474,6 @@ static int php_sqlite3_collation_callback(void *context,
        struct pdo_sqlite_collation *collation = (struct pdo_sqlite_collation*) context;
 
        collation->fc.fci.size = sizeof(collation->fc.fci);
-       collation->fc.fci.function_table = EG(function_table);
        ZVAL_COPY_VALUE(&collation->fc.fci.function_name, &collation->callback);
        collation->fc.fci.object = NULL;
        collation->fc.fci.retval = &retval;
index df13692054737286a466031471efbb31ad22a01c..82a750340916e2de45dc443bfd110d8b70fc4511 100644 (file)
@@ -2823,7 +2823,6 @@ static void php_pgsql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, zend_long result_
 
                if (ce->constructor) {
                        fci.size = sizeof(fci);
-                       fci.function_table = &ce->function_table;
                        ZVAL_UNDEF(&fci.function_name);
                        fci.object = Z_OBJ_P(return_value);
                        fci.retval = &retval;
index 186df87fd7363205479e7f1e345d169b770b136f..fe89db9dee2493b7de2411fcbb03362298767fab 100644 (file)
@@ -1428,7 +1428,6 @@ static void _reflection_export(INTERNAL_FUNCTION_PARAMETERS, zend_class_entry *c
        /* Call __construct() */
 
        fci.size = sizeof(fci);
-       fci.function_table = NULL;
        ZVAL_UNDEF(&fci.function_name);
        fci.object = Z_OBJ(reflector);
        fci.retval = &retval;
@@ -1461,7 +1460,6 @@ static void _reflection_export(INTERNAL_FUNCTION_PARAMETERS, zend_class_entry *c
        ZVAL_COPY_VALUE(&params[1], output_ptr);
 
        ZVAL_STRINGL(&fci.function_name, "reflection::export", sizeof("reflection::export") - 1);
-       fci.function_table = &reflection_ptr->function_table;
        fci.object = NULL;
        fci.retval = &retval;
        fci.param_count = 2;
@@ -1962,7 +1960,6 @@ ZEND_METHOD(reflection_function, invoke)
        }
 
        fci.size = sizeof(fci);
-       fci.function_table = NULL;
        ZVAL_UNDEF(&fci.function_name);
        fci.object = NULL;
        fci.retval = &retval;
@@ -2021,7 +2018,6 @@ ZEND_METHOD(reflection_function, invokeArgs)
        } ZEND_HASH_FOREACH_END();
 
        fci.size = sizeof(fci);
-       fci.function_table = NULL;
        ZVAL_UNDEF(&fci.function_name);
        fci.object = NULL;
        fci.retval = &retval;
@@ -3252,7 +3248,6 @@ ZEND_METHOD(reflection_method, invoke)
        }
 
        fci.size = sizeof(fci);
-       fci.function_table = NULL;
        ZVAL_UNDEF(&fci.function_name);
        fci.object = object;
        fci.retval = &retval;
@@ -3358,7 +3353,6 @@ ZEND_METHOD(reflection_method, invokeArgs)
        }
 
        fci.size = sizeof(fci);
-       fci.function_table = NULL;
        ZVAL_UNDEF(&fci.function_name);
        fci.object = object ? Z_OBJ_P(object) : NULL;
        fci.retval = &retval;
@@ -4890,7 +4884,6 @@ ZEND_METHOD(reflection_class, newInstance)
                }
 
                fci.size = sizeof(fci);
-               fci.function_table = EG(function_table);
                ZVAL_UNDEF(&fci.function_name);
                fci.object = Z_OBJ_P(return_value);
                fci.retval = &retval;
@@ -4993,7 +4986,6 @@ ZEND_METHOD(reflection_class, newInstanceArgs)
                }
 
                fci.size = sizeof(fci);
-               fci.function_table = EG(function_table);
                ZVAL_UNDEF(&fci.function_name);
                fci.object = Z_OBJ_P(return_value);
                fci.retval = &retval;
index fcfa2511ebac9385e9bc3fe9619d6fdc785b6c30..c842ce51191838205af6294dab6828b9cd5ceb19 100644 (file)
@@ -953,7 +953,6 @@ PHP_METHOD(SoapFault, __toString)
        line = zend_read_property(soap_fault_class_entry, this_ptr, "line", sizeof("line")-1, 1, &rv4);
 
        fci.size = sizeof(fci);
-       fci.function_table = &Z_OBJCE_P(getThis())->function_table;
        ZVAL_STRINGL(&fci.function_name, "gettraceasstring", sizeof("gettraceasstring")-1);
        fci.object = Z_OBJ(EX(This));
        fci.retval = &trace;
index 2a1df40fbbb341e7a2997c20b68b5e9adac9214b..51adb18436178a7eaad57df80470234c830970d7 100644 (file)
@@ -2075,7 +2075,6 @@ static int spl_filesystem_file_call(spl_filesystem_object *intern, zend_function
        ZVAL_UNDEF(&retval);
 
        fci.size = sizeof(fci);
-       fci.function_table = EG(function_table);
        fci.object = NULL;
        fci.retval = &retval;
        fci.param_count = num_args;
index 0ee23cac1c54acf2899cdec81564b59b80ae21a4..e73e0f08a07ca64a5e159ec8ba098a5d475d2478 100644 (file)
@@ -62,7 +62,6 @@ static inline void spl_instantiate_arg_n(zend_class_entry *pce, zval *retval, in
        spl_instantiate(pce, retval);
 
        fci.size = sizeof(zend_fcall_info);
-       fci.function_table = &pce->function_table;
        ZVAL_STR(&fci.function_name, func->common.function_name);
        fci.object = Z_OBJ_P(retval);
        fci.retval = &dummy;
index 64b05d7e05e72767574ee97b294d3dbefb3d1c94..d7f77229590ed440c65a1f8f01d6435a6bc3ddd2 100644 (file)
@@ -683,7 +683,6 @@ static int sqlite3_do_callback(struct php_sqlite3_fci *fc, zval *cb, int argc, s
        fake_argc = argc + is_agg;
 
        fc->fci.size = sizeof(fc->fci);
-       fc->fci.function_table = EG(function_table);
        ZVAL_COPY_VALUE(&fc->fci.function_name, cb);
        fc->fci.object = NULL;
        fc->fci.retval = &retval;
@@ -841,7 +840,6 @@ static int php_sqlite3_callback_compare(void *coll, int a_len, const void *a, in
        int ret;
 
        collation->fci.fci.size = (sizeof(collation->fci.fci));
-       collation->fci.fci.function_table = EG(function_table);
        ZVAL_COPY_VALUE(&collation->fci.fci.function_name, &collation->cmp_func);
        collation->fci.fci.object = NULL;
        collation->fci.fci.retval = &retval;
index a3a42655d0b0912fbbff99ddcc33b39bb6c48c22..6b93e2fcc33b1b30d55a5e26da1a4bddbe89a1bb 100644 (file)
@@ -483,7 +483,6 @@ static void xml_call_handler(xml_parser *parser, zval *handler, zend_function *f
                zend_fcall_info fci;
 
                fci.size = sizeof(fci);
-               fci.function_table = EG(function_table);
                ZVAL_COPY_VALUE(&fci.function_name, handler);
                fci.object = Z_OBJ(parser->object);
                fci.retval = retval;
index 1c434039e2e1787d0d079d4f9c1d89e649cbcf9a..533981225343b74dce262bf83eb270c18656a2bf 100644 (file)
@@ -295,7 +295,6 @@ static void xsl_ext_function_php(xmlXPathParserContextPtr ctxt, int nargs, int t
        }
 
        fci.size = sizeof(fci);
-       fci.function_table = EG(function_table);
        if (fci.param_count > 0) {
                fci.params = args;
        } else {
index 00775aa0c806c03d24a6837100219e1bd1aae3dd..5ad7dc2e649d6fb68a70729ce9230c7609a17b1b 100644 (file)
@@ -299,7 +299,6 @@ static void user_stream_create_object(struct php_user_stream_wrapper *uwrap, php
                zval retval;
 
                fci.size = sizeof(fci);
-               fci.function_table = &uwrap->ce->function_table;
                ZVAL_UNDEF(&fci.function_name);
                fci.object = Z_OBJ_P(object);
                fci.retval = &retval;
index ac86c15629b9eb4a37fdf3c7dc023172ca083b5d..a9fd351ffdc773a0cc49a354ecfba07f279cd676 100644 (file)
@@ -120,7 +120,6 @@ static inline int phpdbg_call_register(phpdbg_param_t *stack) /* {{{ */
 
                        ZVAL_STRINGL(&fci.function_name, lc_name, name->len);
                        fci.size = sizeof(zend_fcall_info);
-                       fci.function_table = &PHPDBG_G(registered);
                        //???fci.symbol_table = zend_rebuild_symbol_table();
                        fci.object = NULL;
                        fci.retval = &fretval;