diff options
-rw-r--r-- | Zend/zend_API.c | 14 | ||||
-rw-r--r-- | Zend/zend_execute.c | 24 | ||||
-rw-r--r-- | Zend/zend_ini.c | 7 | ||||
-rw-r--r-- | Zend/zend_opcode.c | 7 | ||||
-rw-r--r-- | sapi/cgi/cgi_main.c | 2 | ||||
-rw-r--r-- | sapi/cli/php_cli.c | 2 |
6 files changed, 36 insertions, 20 deletions
diff --git a/Zend/zend_API.c b/Zend/zend_API.c index 22ba10b029..a52abe3544 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 1979f59b09..fa0e4634f3 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 883a6bf84b..ca4e4d7863 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 d1c4e681e1..c0fc94a120 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 cb76caaa93..16f11fd40c 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 2156cb14fc..d353b00a06 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); } /* }}} */ |