com php-src: Fixed apply_func_t (they should be b roken before): Zend/zend_API.c Zend/zend_execut e.c Zend/zend_ini.c Zend/zend_opcode.c sapi/cgi
/cgi_main.c sapi/cli/php_cli.c

From: Date: Sun, 25 May 2014 10:32:35 +0000
Subject: com php-src: Fixed apply_func_t (they should be b roken before): Zend/zend_API.c Zend/zend_execut e.c Zend/zend_ini.c Zend/zend_opcode.c sapi/cgi
/cgi_main.c sapi/cli/php_cli.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-78521@lists.php.net to get a copy of this message
Commit: c2082ece52bcb5343ae0feb460807596cd79d691 Author: Xinchen Hui <laruence@php.net> Sun, 25 May 2014 18:32:35 +0800 Parents: 5d7f82745f46025af4fd89f7e3f3883e92d55509 Branches: phpng Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=c2082ece52bcb5343ae0feb460807596cd79d691 Log: Fixed apply_func_t (they should be broken before) Changed paths: M Zend/zend_API.c M Zend/zend_execute.c M Zend/zend_ini.c M Zend/zend_opcode.c M sapi/cgi/cgi_main.c M sapi/cli/php_cli.c Diff: diff --git a/Zend/zend_API.c b/Zend/zend_API.c index 22ba10b..a52abe3 100644 --- a/Zend/zend_API.c +++ b/Zend/zend_API.c @@ -2583,8 +2583,16 @@ int module_registry_unload_temp(const zend_module_entry *module TSRMLS_DC) /* {{ } /* }}} */ -static int exec_done_cb(zend_module_entry *module TSRMLS_DC) /* {{{ */ +static int module_registry_unload_temp_wrapper(zval *el TSRMLS_DC) /* {{{ */ { + zend_module_entry *module = (zend_module_entry *)Z_PTR_P(el); + return module_registry_unload_temp((const zend_module_entry *)module TSRMLS_CC); +} +/* }}} */ + +static int exec_done_cb(zval *el TSRMLS_DC) /* {{{ */ +{ + zend_module_entry *module = (zend_module_entry *)Z_PTR_P(el); if (module->post_deactivate_func) { module->post_deactivate_func(); } @@ -2595,8 +2603,8 @@ static int exec_done_cb(zend_module_entry *module TSRMLS_DC) /* {{{ */ ZEND_API void zend_post_deactivate_modules(TSRMLS_D) /* {{{ */ { if (EG(full_tables_cleanup)) { - zend_hash_apply(&module_registry, (apply_func_t) exec_done_cb TSRMLS_CC); - zend_hash_reverse_apply(&module_registry, (apply_func_t) module_registry_unload_temp TSRMLS_CC); + zend_hash_apply(&module_registry, exec_done_cb TSRMLS_CC); + zend_hash_reverse_apply(&module_registry, module_registry_unload_temp_wrapper TSRMLS_CC); } else { zend_module_entry **p = module_post_deactivate_handlers; diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c index 1979f59..fa0e463 100644 --- a/Zend/zend_execute.c +++ b/Zend/zend_execute.c @@ -1452,26 +1452,28 @@ static inline zend_brk_cont_element* zend_brk_cont(int nest_levels, int array_of #if ZEND_INTENSIVE_DEBUGGING -#define CHECK_SYMBOL_TABLES() \ - zend_hash_apply(&EG(symbol_table), (apply_func_t) zend_check_symbol TSRMLS_CC); \ - if (&EG(symbol_table)!=EG(active_symbol_table)) { \ - zend_hash_apply(EG(active_symbol_table), (apply_func_t) zend_check_symbol TSRMLS_CC); \ +#define CHECK_SYMBOL_TABLES() \ + zend_hash_apply(&EG(symbol_table), zend_check_symbol TSRMLS_CC); \ + if (&EG(symbol_table)!=EG(active_symbol_table)) { \ + zend_hash_apply(EG(active_symbol_table), zend_check_symbol TSRMLS_CC); \ } -static int zend_check_symbol(zval **pz TSRMLS_DC) +static int zend_check_symbol(zval *pz TSRMLS_DC) { - if (Z_TYPE_PP(pz) > 9) { + if (Z_TYPE_P(pz) == IS_INDIRECT) { + pz = Z_INDIRECT_P(pz); + } + if (Z_TYPE_P(pz) > 10) { fprintf(stderr, "Warning! %x has invalid type!\n", *pz); /* See http://support.microsoft.com/kb/190351 */ #ifdef PHP_WIN32 fflush(stderr); #endif - } else if (Z_TYPE_PP(pz) == IS_ARRAY) { - zend_hash_apply(Z_ARRVAL_PP(pz), (apply_func_t) zend_check_symbol TSRMLS_CC); - } else if (Z_TYPE_PP(pz) == IS_OBJECT) { - + } else if (Z_TYPE_P(pz) == IS_ARRAY) { + zend_hash_apply(Z_ARRVAL_P(pz), zend_check_symbol TSRMLS_CC); + } else if (Z_TYPE_P(pz) == IS_OBJECT) { /* OBJ-TBI - doesn't support new object model! */ - zend_hash_apply(Z_OBJPROP_PP(pz), (apply_func_t) zend_check_symbol TSRMLS_CC); + zend_hash_apply(Z_OBJPROP_P(pz), zend_check_symbol TSRMLS_CC); } return 0; diff --git a/Zend/zend_ini.c b/Zend/zend_ini.c index 883a6bf..ca4e4d7 100644 --- a/Zend/zend_ini.c +++ b/Zend/zend_ini.c @@ -76,9 +76,10 @@ static int zend_restore_ini_entry_cb(zend_ini_entry *ini_entry, int stage TSRMLS } /* }}} */ -static int zend_restore_ini_entry_wrapper(zend_ini_entry **ini_entry TSRMLS_DC) /* {{{ */ +static int zend_restore_ini_entry_wrapper(zval *el TSRMLS_DC) /* {{{ */ { - zend_restore_ini_entry_cb(*ini_entry, ZEND_INI_STAGE_DEACTIVATE TSRMLS_CC); + zend_ini_entry *ini_entry = (zend_ini_entry *)Z_PTR_P(el); + zend_restore_ini_entry_cb(ini_entry, ZEND_INI_STAGE_DEACTIVATE TSRMLS_CC); return 1; } /* }}} */ @@ -123,7 +124,7 @@ ZEND_API int zend_ini_global_shutdown(TSRMLS_D) /* {{{ */ ZEND_API int zend_ini_deactivate(TSRMLS_D) /* {{{ */ { if (EG(modified_ini_directives)) { - zend_hash_apply(EG(modified_ini_directives), (apply_func_t) zend_restore_ini_entry_wrapper TSRMLS_CC); + zend_hash_apply(EG(modified_ini_directives), zend_restore_ini_entry_wrapper TSRMLS_CC); zend_hash_destroy(EG(modified_ini_directives)); FREE_HASHTABLE(EG(modified_ini_directives)); EG(modified_ini_directives) = NULL; diff --git a/Zend/zend_opcode..c b/Zend/zend_opcode.c index d1c4e68..c0fc94a 100644 --- a/Zend/zend_opcode.c +++ b/Zend/zend_opcode.c @@ -715,10 +715,15 @@ ZEND_API int pass_two(zend_op_array *op_array TSRMLS_DC) return 0; } +int pass_two_wrapper(zval *el TSRMLS_DC) +{ + return pass_two((zend_op_array*)Z_PTR_P(el)); +} + int print_class(zend_class_entry *class_entry TSRMLS_DC) { printf("Class %s:\n", class_entry->name->val); - zend_hash_apply(&class_entry->function_table, (apply_func_t) pass_two TSRMLS_CC); + zend_hash_apply(&class_entry->function_table, pass_two_wrapper TSRMLS_CC); printf("End of class %s.\n\n", class_entry->name->val); return 0; } diff --git a/sapi/cgi/cgi_main.c b/sapi/cgi/cgi_main.c index cb76caa..16f11fd 100644 --- a/sapi/cgi/cgi_main.c +++ b/sapi/cgi/cgi_main.c @@ -241,7 +241,7 @@ static void print_modules(TSRMLS_D) //??? zend_hash_copy(&sorted_registry, &module_registry, NULL, &tmp, sizeof(zend_module_entry)); zend_hash_copy(&sorted_registry, &module_registry, NULL); zend_hash_sort(&sorted_registry, zend_qsort, module_name_cmp, 0 TSRMLS_CC); - zend_hash_apply(&sorted_registry, (apply_func_t) print_module_info TSRMLS_CC); + zend_hash_apply(&sorted_registry, print_module_info TSRMLS_CC); zend_hash_destroy(&sorted_registry); } diff --git a/sapi/cli/php_cli.c b/sapi/cli/php_cli.c index 2156cb1..d353b00 100644 --- a/sapi/cli/php_cli.c +++ b/sapi/cli/php_cli.c @@ -198,7 +198,7 @@ static void print_modules(TSRMLS_D) /* {{{ */ zend_hash_init(&sorted_registry, 50, NULL, NULL, 0); zend_hash_copy(&sorted_registry, &module_registry, NULL); zend_hash_sort(&sorted_registry, zend_qsort, module_name_cmp, 0 TSRMLS_CC); - zend_hash_apply(&sorted_registry, (apply_func_t) print_module_info TSRMLS_CC); + zend_hash_apply(&sorted_registry, print_module_info TSRMLS_CC); zend_hash_destroy(&sorted_registry); } /* }}} */

« previous php.cvs (#78521) next »