@@ -2713,8 +2713,8 @@ ZEND_END_ARG_INFO()
27132713ZEND_API zend_result zend_register_functions (zend_class_entry * scope , const zend_function_entry * functions , HashTable * function_table , int type ) /* {{{ */
27142714{
27152715 const zend_function_entry * ptr = functions ;
2716- zend_function function , * reg_function ;
2717- zend_internal_function * internal_function = (zend_internal_function * )& function ;
2716+ zend_function function ;
2717+ zend_internal_function * reg_function , * internal_function = (zend_internal_function * )& function ;
27182718 int count = 0 , unload = 0 ;
27192719 HashTable * target_function_table = function_table ;
27202720 int error_type ;
@@ -2847,23 +2847,23 @@ ZEND_API zend_result zend_register_functions(zend_class_entry *scope, const zend
28472847 }
28482848
28492849 /* Get parameter count including variadic parameter. */
2850- uint32_t num_args = reg_function -> common . num_args ;
2851- if (reg_function -> common . fn_flags & ZEND_ACC_VARIADIC ) {
2850+ uint32_t num_args = reg_function -> num_args ;
2851+ if (reg_function -> fn_flags & ZEND_ACC_VARIADIC ) {
28522852 num_args ++ ;
28532853 }
28542854
28552855 /* If types of arguments have to be checked */
2856- if (reg_function -> common . arg_info && num_args ) {
2856+ if (reg_function -> arg_info && num_args ) {
28572857 uint32_t i ;
28582858 for (i = 0 ; i < num_args ; i ++ ) {
2859- zend_internal_arg_info * arg_info = & reg_function -> internal_function . arg_info [i ];
2859+ zend_internal_arg_info * arg_info = & reg_function -> arg_info [i ];
28602860 ZEND_ASSERT (arg_info -> name && "Parameter must have a name" );
28612861 if (ZEND_TYPE_IS_SET (arg_info -> type )) {
2862- reg_function -> common . fn_flags |= ZEND_ACC_HAS_TYPE_HINTS ;
2862+ reg_function -> fn_flags |= ZEND_ACC_HAS_TYPE_HINTS ;
28632863 }
28642864#if ZEND_DEBUG
28652865 for (uint32_t j = 0 ; j < i ; j ++ ) {
2866- if (!strcmp (arg_info -> name , reg_function -> internal_function . arg_info [j ].name )) {
2866+ if (!strcmp (arg_info -> name , reg_function -> arg_info [j ].name )) {
28672867 zend_error_noreturn (E_CORE_ERROR ,
28682868 "Duplicate parameter name $%s for function %s%s%s()" , arg_info -> name ,
28692869 scope ? ZSTR_VAL (scope -> name ) : "" , scope ? "::" : "" , ptr -> fname );
@@ -2874,18 +2874,18 @@ ZEND_API zend_result zend_register_functions(zend_class_entry *scope, const zend
28742874 }
28752875
28762876 /* Rebuild arginfos if parameter/property types and/or a return type are used */
2877- if (reg_function -> common . arg_info &&
2878- (reg_function -> common . fn_flags & (ZEND_ACC_HAS_RETURN_TYPE |ZEND_ACC_HAS_TYPE_HINTS ))) {
2877+ if (reg_function -> arg_info &&
2878+ (reg_function -> fn_flags & (ZEND_ACC_HAS_RETURN_TYPE |ZEND_ACC_HAS_TYPE_HINTS ))) {
28792879 /* convert "const char*" class type names into "zend_string*" */
28802880 uint32_t i ;
2881- zend_arg_info * arg_info = reg_function -> common . arg_info - 1 ;
2882- zend_arg_info * new_arg_info ;
2881+ zend_internal_arg_info * arg_info = reg_function -> arg_info - 1 ;
2882+ zend_internal_arg_info * new_arg_info ;
28832883
28842884 /* Treat return type as an extra argument */
28852885 num_args ++ ;
2886- new_arg_info = malloc (sizeof (zend_arg_info ) * num_args );
2887- memcpy (new_arg_info , arg_info , sizeof (zend_arg_info ) * num_args );
2888- reg_function -> common . arg_info = new_arg_info + 1 ;
2886+ new_arg_info = malloc (sizeof (zend_internal_arg_info ) * num_args );
2887+ memcpy (new_arg_info , arg_info , sizeof (zend_internal_arg_info ) * num_args );
2888+ reg_function -> arg_info = new_arg_info + 1 ;
28892889 for (i = 0 ; i < num_args ; i ++ ) {
28902890 if (ZEND_TYPE_IS_COMPLEX (new_arg_info [i ].type )) {
28912891 ZEND_ASSERT (ZEND_TYPE_HAS_NAME (new_arg_info [i ].type )
@@ -2939,8 +2939,8 @@ ZEND_API zend_result zend_register_functions(zend_class_entry *scope, const zend
29392939
29402940 if (scope ) {
29412941 zend_check_magic_method_implementation (
2942- scope , reg_function , lowercase_name , E_CORE_ERROR );
2943- zend_add_magic_method (scope , reg_function , lowercase_name );
2942+ scope , ( zend_function * ) reg_function , lowercase_name , E_CORE_ERROR );
2943+ zend_add_magic_method (scope , ( zend_function * ) reg_function , lowercase_name );
29442944 }
29452945 ptr ++ ;
29462946 count ++ ;
0 commit comments