From c67c166f930b2f815a805a3376e9244794e20c31 Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Wed, 2 Mar 2016 17:50:55 +0300 Subject: [PATCH] Removed zend_fcall_info.symbol_table --- Zend/zend_API.c | 1 - Zend/zend_API.h | 6 ++++-- Zend/zend_exceptions.c | 1 - Zend/zend_execute_API.c | 9 ++------- Zend/zend_interfaces.c | 1 - ext/curl/interface.c | 5 ----- ext/dom/xpath.c | 1 - ext/mysqli/mysqli.c | 1 - ext/pdo/pdo_dbh.c | 1 - ext/pdo/pdo_stmt.c | 1 - ext/pdo_sqlite/sqlite_driver.c | 2 -- ext/pgsql/pgsql.c | 1 - ext/reflection/php_reflection.c | 7 ------- ext/soap/soap.c | 1 - ext/spl/spl_directory.c | 1 - ext/spl/spl_engine.h | 1 - ext/sqlite3/sqlite3.c | 2 -- ext/xml/xml.c | 1 - ext/xsl/xsltprocessor.c | 1 - main/streams/userspace.c | 1 - sapi/phpdbg/phpdbg_prompt.c | 1 - 21 files changed, 6 insertions(+), 40 deletions(-) diff --git a/Zend/zend_API.c b/Zend/zend_API.c index e9cf134ede..5ebfe2cb17 100644 --- a/Zend/zend_API.c +++ b/Zend/zend_API.c @@ -3427,7 +3427,6 @@ ZEND_API int zend_fcall_info_init(zval *callable, uint check_flags, zend_fcall_i fci->param_count = 0; fci->params = NULL; fci->no_separation = 1; - fci->symbol_table = NULL; return SUCCESS; } diff --git a/Zend/zend_API.h b/Zend/zend_API.h index db4b9a8819..40c814f71d 100644 --- a/Zend/zend_API.h +++ b/Zend/zend_API.h @@ -45,7 +45,6 @@ typedef struct _zend_fcall_info { size_t size; HashTable *function_table; zval function_name; - zend_array *symbol_table; zval *retval; zval *params; zend_object *object; @@ -470,7 +469,10 @@ ZEND_API int add_property_zval_ex(zval *arg, const char *key, size_t key_len, zv 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_array *symbol_table); +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); + +#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) ZEND_API extern const zend_fcall_info empty_fcall_info; ZEND_API extern const zend_fcall_info_cache empty_fcall_info_cache; diff --git a/Zend/zend_exceptions.c b/Zend/zend_exceptions.c index 6195ef904a..21dfdc5146 100644 --- a/Zend/zend_exceptions.c +++ b/Zend/zend_exceptions.c @@ -676,7 +676,6 @@ ZEND_METHOD(exception, __toString) fci.size = sizeof(fci); fci.function_table = &Z_OBJCE_P(exception)->function_table; ZVAL_COPY_VALUE(&fci.function_name, &fname); - fci.symbol_table = NULL; fci.object = Z_OBJ_P(exception); fci.retval = &trace; fci.param_count = 0; diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c index 733688d2c7..bbf25863c9 100644 --- a/Zend/zend_execute_API.c +++ b/Zend/zend_execute_API.c @@ -668,7 +668,7 @@ int call_user_function(HashTable *function_table, zval *object, zval *function_n } /* }}} */ -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_array *symbol_table) /* {{{ */ +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_fcall_info fci; @@ -680,7 +680,6 @@ int call_user_function_ex(HashTable *function_table, zval *object, zval *functio fci.param_count = param_count; fci.params = params; fci.no_separation = (zend_bool) no_separation; - fci.symbol_table = symbol_table; return zend_call_function(&fci, NULL); } @@ -851,13 +850,10 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache) / ZEND_ADD_CALL_FLAG(call, ZEND_CALL_CLOSURE); } - /* PHP-7 doesn't support symbol_table substitution for functions */ - ZEND_ASSERT(fci->symbol_table == NULL); - if (func->type == ZEND_USER_FUNCTION) { int call_via_handler = (func->common.fn_flags & ZEND_ACC_CALL_VIA_TRAMPOLINE) != 0; EG(scope) = func->common.scope; - call->symbol_table = fci->symbol_table; + call->symbol_table = NULL; if (EXPECTED((func->op_array.fn_flags & ZEND_ACC_GENERATOR) == 0)) { zend_init_execute_data(call, &func->op_array, fci->retval); zend_execute_ex(call); @@ -1027,7 +1023,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.symbol_table = NULL; fcall_info.retval = &local_retval; fcall_info.param_count = 1; fcall_info.params = args; diff --git a/Zend/zend_interfaces.c b/Zend/zend_interfaces.c index 6ad8966870..c7d225704f 100644 --- a/Zend/zend_interfaces.c +++ b/Zend/zend_interfaces.c @@ -55,7 +55,6 @@ ZEND_API zval* zend_call_method(zval *object, zend_class_entry *obj_ce, zend_fun fci.param_count = param_count; fci.params = params; fci.no_separation = 1; - fci.symbol_table = NULL; if (!fn_proxy && !obj_ce) { /* no interest in caching and no information already present that is diff --git a/ext/curl/interface.c b/ext/curl/interface.c index 0a7f7c72e8..58e1814d09 100644 --- a/ext/curl/interface.c +++ b/ext/curl/interface.c @@ -1345,7 +1345,6 @@ static size_t curl_write(char *data, size_t size, size_t nmemb, void *ctx) fci.param_count = 2; fci.params = argv; fci.no_separation = 0; - fci.symbol_table = NULL; ch->in_callback = 1; error = zend_call_function(&fci, &t->fci_cache); @@ -1396,7 +1395,6 @@ static int curl_fnmatch(void *ctx, const char *pattern, const char *string) fci.param_count = 3; fci.params = argv; fci.no_separation = 0; - fci.symbol_table = NULL; ch->in_callback = 1; error = zend_call_function(&fci, &t->fci_cache); @@ -1453,7 +1451,6 @@ static size_t curl_progress(void *clientp, double dltotal, double dlnow, double fci.param_count = 5; fci.params = argv; fci.no_separation = 0; - fci.symbol_table = NULL; ch->in_callback = 1; error = zend_call_function(&fci, &t->fci_cache); @@ -1516,7 +1513,6 @@ static size_t curl_read(char *data, size_t size, size_t nmemb, void *ctx) fci.param_count = 3; fci.params = argv; fci.no_separation = 0; - fci.symbol_table = NULL; ch->in_callback = 1; error = zend_call_function(&fci, &t->fci_cache); @@ -1579,7 +1575,6 @@ static size_t curl_write_header(char *data, size_t size, size_t nmemb, void *ctx fci.size = sizeof(fci); fci.function_table = EG(function_table); ZVAL_COPY_VALUE(&fci.function_name, &t->func_name); - fci.symbol_table = NULL; fci.object = NULL; fci.retval = &retval; fci.param_count = 2; diff --git a/ext/dom/xpath.c b/ext/dom/xpath.c index 75c4a49bc1..3cc9abaa3c 100644 --- a/ext/dom/xpath.c +++ b/ext/dom/xpath.c @@ -188,7 +188,6 @@ static void dom_xpath_ext_function_php(xmlXPathParserContextPtr ctxt, int nargs, ZVAL_STRING(&fci.function_name, (char *) obj->stringval); xmlXPathFreeObject(obj); - fci.symbol_table = NULL; fci.object = NULL; fci.retval = &retval; fci.no_separation = 0; diff --git a/ext/mysqli/mysqli.c b/ext/mysqli/mysqli.c index f21e752517..d6282b8126 100644 --- a/ext/mysqli/mysqli.c +++ b/ext/mysqli/mysqli.c @@ -1286,7 +1286,6 @@ void php_mysqli_fetch_into_hash(INTERNAL_FUNCTION_PARAMETERS, int override_flags fci.size = sizeof(fci); fci.function_table = &ce->function_table; ZVAL_UNDEF(&fci.function_name); - fci.symbol_table = NULL; fci.object = Z_OBJ_P(return_value); fci.retval = &retval; fci.params = NULL; diff --git a/ext/pdo/pdo_dbh.c b/ext/pdo/pdo_dbh.c index 0b2053d0d3..1d77f3e0eb 100644 --- a/ext/pdo/pdo_dbh.c +++ b/ext/pdo/pdo_dbh.c @@ -439,7 +439,6 @@ static void pdo_stmt_construct(zend_execute_data *execute_data, pdo_stmt_t *stmt fci.function_table = &dbstmt_ce->function_table; ZVAL_UNDEF(&fci.function_name); fci.object = Z_OBJ_P(object); - fci.symbol_table = NULL; fci.retval = &retval; fci.param_count = 0; fci.params = NULL; diff --git a/ext/pdo/pdo_stmt.c b/ext/pdo/pdo_stmt.c index 6019c39aba..1cc615eb31 100644 --- a/ext/pdo/pdo_stmt.c +++ b/ext/pdo/pdo_stmt.c @@ -742,7 +742,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->symbol_table = NULL; fci->retval = &stmt->fetch.cls.retval; fci->param_count = 0; fci->params = NULL; diff --git a/ext/pdo_sqlite/sqlite_driver.c b/ext/pdo_sqlite/sqlite_driver.c index 346cdf2f27..8c732b9dbe 100644 --- a/ext/pdo_sqlite/sqlite_driver.c +++ b/ext/pdo_sqlite/sqlite_driver.c @@ -327,7 +327,6 @@ static int do_callback(struct pdo_sqlite_fci *fc, zval *cb, fc->fci.size = sizeof(fc->fci); fc->fci.function_table = EG(function_table); ZVAL_COPY_VALUE(&fc->fci.function_name, cb); - fc->fci.symbol_table = NULL; fc->fci.object = NULL; fc->fci.retval = &retval; fc->fci.param_count = fake_argc; @@ -478,7 +477,6 @@ static int php_sqlite3_collation_callback(void *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.symbol_table = NULL; collation->fc.fci.object = NULL; collation->fc.fci.retval = &retval; diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c index 5c82fd8b43..34ae0d02f7 100644 --- a/ext/pgsql/pgsql.c +++ b/ext/pgsql/pgsql.c @@ -2826,7 +2826,6 @@ static void php_pgsql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, zend_long result_ fci.size = sizeof(fci); fci.function_table = &ce->function_table; ZVAL_UNDEF(&fci.function_name); - fci.symbol_table = NULL; fci.object = Z_OBJ_P(return_value); fci.retval = &retval; fci.params = NULL; diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index af1e972f60..68aa136d90 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -1430,7 +1430,6 @@ static void _reflection_export(INTERNAL_FUNCTION_PARAMETERS, zend_class_entry *c fci.size = sizeof(fci); fci.function_table = NULL; ZVAL_UNDEF(&fci.function_name); - fci.symbol_table = NULL; fci.object = Z_OBJ(reflector); fci.retval = &retval; fci.param_count = ctor_argc; @@ -1965,7 +1964,6 @@ ZEND_METHOD(reflection_function, invoke) fci.size = sizeof(fci); fci.function_table = NULL; ZVAL_UNDEF(&fci.function_name); - fci.symbol_table = NULL; fci.object = NULL; fci.retval = &retval; fci.param_count = num_args; @@ -2025,7 +2023,6 @@ ZEND_METHOD(reflection_function, invokeArgs) fci.size = sizeof(fci); fci.function_table = NULL; ZVAL_UNDEF(&fci.function_name); - fci.symbol_table = NULL; fci.object = NULL; fci.retval = &retval; fci.param_count = argc; @@ -3257,7 +3254,6 @@ ZEND_METHOD(reflection_method, invoke) fci.size = sizeof(fci); fci.function_table = NULL; ZVAL_UNDEF(&fci.function_name); - fci.symbol_table = NULL; fci.object = object; fci.retval = &retval; fci.param_count = num_args - 1; @@ -3364,7 +3360,6 @@ ZEND_METHOD(reflection_method, invokeArgs) fci.size = sizeof(fci); fci.function_table = NULL; ZVAL_UNDEF(&fci.function_name); - fci.symbol_table = NULL; fci.object = object ? Z_OBJ_P(object) : NULL; fci.retval = &retval; fci.param_count = argc; @@ -4897,7 +4892,6 @@ ZEND_METHOD(reflection_class, newInstance) fci.size = sizeof(fci); fci.function_table = EG(function_table); ZVAL_UNDEF(&fci.function_name); - fci.symbol_table = NULL; fci.object = Z_OBJ_P(return_value); fci.retval = &retval; fci.param_count = num_args; @@ -5001,7 +4995,6 @@ ZEND_METHOD(reflection_class, newInstanceArgs) fci.size = sizeof(fci); fci.function_table = EG(function_table); ZVAL_UNDEF(&fci.function_name); - fci.symbol_table = NULL; fci.object = Z_OBJ_P(return_value); fci.retval = &retval; fci.param_count = argc; diff --git a/ext/soap/soap.c b/ext/soap/soap.c index ee41ff908f..08d5bc0514 100644 --- a/ext/soap/soap.c +++ b/ext/soap/soap.c @@ -955,7 +955,6 @@ PHP_METHOD(SoapFault, __toString) fci.size = sizeof(fci); fci.function_table = &Z_OBJCE_P(getThis())->function_table; ZVAL_STRINGL(&fci.function_name, "gettraceasstring", sizeof("gettraceasstring")-1); - fci.symbol_table = NULL; fci.object = Z_OBJ(EX(This)); fci.retval = &trace; fci.param_count = 0; diff --git a/ext/spl/spl_directory.c b/ext/spl/spl_directory.c index 412fc54324..2a1df40fbb 100644 --- a/ext/spl/spl_directory.c +++ b/ext/spl/spl_directory.c @@ -2081,7 +2081,6 @@ static int spl_filesystem_file_call(spl_filesystem_object *intern, zend_function fci.param_count = num_args; fci.params = params; fci.no_separation = 1; - fci.symbol_table = NULL; ZVAL_STR(&fci.function_name, func_ptr->common.function_name); fcic.initialized = 1; diff --git a/ext/spl/spl_engine.h b/ext/spl/spl_engine.h index c5f0927953..0ee23cac1c 100644 --- a/ext/spl/spl_engine.h +++ b/ext/spl/spl_engine.h @@ -65,7 +65,6 @@ static inline void spl_instantiate_arg_n(zend_class_entry *pce, zval *retval, in fci.function_table = &pce->function_table; ZVAL_STR(&fci.function_name, func->common.function_name); fci.object = Z_OBJ_P(retval); - fci.symbol_table = NULL; fci.retval = &dummy; fci.param_count = argc; fci.params = argv; diff --git a/ext/sqlite3/sqlite3.c b/ext/sqlite3/sqlite3.c index 6416d03e89..1bccb9d7f1 100644 --- a/ext/sqlite3/sqlite3.c +++ b/ext/sqlite3/sqlite3.c @@ -685,7 +685,6 @@ static int sqlite3_do_callback(struct php_sqlite3_fci *fc, zval *cb, int argc, s fc->fci.size = sizeof(fc->fci); fc->fci.function_table = EG(function_table); ZVAL_COPY_VALUE(&fc->fci.function_name, cb); - fc->fci.symbol_table = NULL; fc->fci.object = NULL; fc->fci.retval = &retval; fc->fci.param_count = fake_argc; @@ -844,7 +843,6 @@ static int php_sqlite3_callback_compare(void *coll, int a_len, const void *a, in 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.symbol_table = NULL; collation->fci.fci.object = NULL; collation->fci.fci.retval = &retval; collation->fci.fci.param_count = 2; diff --git a/ext/xml/xml.c b/ext/xml/xml.c index 49b72a0acc..e18b4e7eef 100644 --- a/ext/xml/xml.c +++ b/ext/xml/xml.c @@ -485,7 +485,6 @@ static void xml_call_handler(xml_parser *parser, zval *handler, zend_function *f fci.size = sizeof(fci); fci.function_table = EG(function_table); ZVAL_COPY_VALUE(&fci.function_name, handler); - fci.symbol_table = NULL; fci.object = Z_OBJ(parser->object); fci.retval = retval; fci.param_count = argc; diff --git a/ext/xsl/xsltprocessor.c b/ext/xsl/xsltprocessor.c index 600c7cddb0..1c434039e2 100644 --- a/ext/xsl/xsltprocessor.c +++ b/ext/xsl/xsltprocessor.c @@ -320,7 +320,6 @@ static void xsl_ext_function_php(xmlXPathParserContextPtr ctxt, int nargs, int t xmlXPathFreeObject(obj); ZVAL_COPY_VALUE(&fci.function_name, &handler); - fci.symbol_table = NULL; fci.object = NULL; fci.retval = &retval; fci.no_separation = 0; diff --git a/main/streams/userspace.c b/main/streams/userspace.c index 63a351a59b..00775aa0c8 100644 --- a/main/streams/userspace.c +++ b/main/streams/userspace.c @@ -301,7 +301,6 @@ static void user_stream_create_object(struct php_user_stream_wrapper *uwrap, php fci.size = sizeof(fci); fci.function_table = &uwrap->ce->function_table; ZVAL_UNDEF(&fci.function_name); - fci.symbol_table = NULL; fci.object = Z_OBJ_P(object); fci.retval = &retval; fci.param_count = 0; diff --git a/sapi/phpdbg/phpdbg_prompt.c b/sapi/phpdbg/phpdbg_prompt.c index 5b3b546466..8a4bd3a3ac 100644 --- a/sapi/phpdbg/phpdbg_prompt.c +++ b/sapi/phpdbg/phpdbg_prompt.c @@ -122,7 +122,6 @@ static inline int phpdbg_call_register(phpdbg_param_t *stack) /* {{{ */ fci.size = sizeof(zend_fcall_info); fci.function_table = &PHPDBG_G(registered); //???fci.symbol_table = zend_rebuild_symbol_table(); - fci.symbol_table = NULL; fci.object = NULL; fci.retval = &fretval; fci.no_separation = 1; -- 2.40.0