@@ -195,15 +195,6 @@ static zend_function *_copy_function(zend_function *fptr) /* {{{ */
195
195
}
196
196
/* }}} */
197
197
198
- static void _fix_closure_prototype (zend_function * fptr ) /* {{{ */
199
- {
200
- /* Actually we are setting proxy function's prototype to null
201
- * as for it, the prototype is an object not a function
202
- * which could cause serious problems, see #74949 */
203
- fptr -> common .prototype = NULL ;
204
- }
205
- /* }}} */
206
-
207
198
static void _free_function (zend_function * fptr ) /* {{{ */
208
199
{
209
200
if (fptr
@@ -502,7 +493,6 @@ static void _class_string(smart_str *str, zend_class_entry *ce, zval *obj, char
502
493
&& memcmp (ZSTR_VAL (mptr -> common .function_name ), ZEND_INVOKE_FUNC_NAME , sizeof (ZEND_INVOKE_FUNC_NAME )- 1 ) == 0
503
494
&& (closure = zend_get_closure_invoke_method (Z_OBJ_P (obj ))) != NULL )
504
495
{
505
- _fix_closure_prototype (closure );
506
496
mptr = closure ;
507
497
} else {
508
498
closure = NULL ;
@@ -2347,7 +2337,6 @@ ZEND_METHOD(reflection_parameter, __construct)
2347
2337
{
2348
2338
/* nothing to do. don't set is_closure since is the invoke handler,
2349
2339
not the closure itself */
2350
- _fix_closure_prototype (fptr );
2351
2340
} else if ((fptr = zend_hash_str_find_ptr (& ce -> function_table , lcname , lcname_len )) == NULL ) {
2352
2341
efree (lcname );
2353
2342
zend_throw_exception_ex (reflection_exception_ptr , 0 ,
@@ -3031,7 +3020,6 @@ ZEND_METHOD(reflection_method, __construct)
3031
3020
&& (mptr = zend_get_closure_invoke_method (Z_OBJ_P (orig_obj ))) != NULL )
3032
3021
{
3033
3022
/* do nothing, mptr already set */
3034
- _fix_closure_prototype (mptr );
3035
3023
} else if ((mptr = zend_hash_str_find_ptr (& ce -> function_table , lcname , name_len )) == NULL ) {
3036
3024
efree (lcname );
3037
3025
zend_throw_exception_ex (reflection_exception_ptr , 0 ,
@@ -4154,15 +4142,13 @@ ZEND_METHOD(reflection_class, getMethod)
4154
4142
{
4155
4143
/* don't assign closure_object since we only reflect the invoke handler
4156
4144
method and not the closure definition itself */
4157
- _fix_closure_prototype (mptr );
4158
4145
reflection_method_factory (ce , mptr , NULL , return_value );
4159
4146
efree (lc_name );
4160
4147
} else if (ce == zend_ce_closure && Z_ISUNDEF (intern -> obj ) && (name_len == sizeof (ZEND_INVOKE_FUNC_NAME )- 1 )
4161
4148
&& memcmp (lc_name , ZEND_INVOKE_FUNC_NAME , sizeof (ZEND_INVOKE_FUNC_NAME )- 1 ) == 0
4162
4149
&& object_init_ex (& obj_tmp , ce ) == SUCCESS && (mptr = zend_get_closure_invoke_method (Z_OBJ (obj_tmp ))) != NULL ) {
4163
4150
/* don't assign closure_object since we only reflect the invoke handler
4164
4151
method and not the closure definition itself */
4165
- _fix_closure_prototype (mptr );
4166
4152
reflection_method_factory (ce , mptr , NULL , return_value );
4167
4153
zval_dtor (& obj_tmp );
4168
4154
efree (lc_name );
@@ -4189,7 +4175,6 @@ static void _addmethod(zend_function *mptr, zend_class_entry *ce, zval *retval,
4189
4175
&& memcmp (ZSTR_VAL (mptr -> common .function_name ), ZEND_INVOKE_FUNC_NAME , sizeof (ZEND_INVOKE_FUNC_NAME )- 1 ) == 0
4190
4176
&& (closure = zend_get_closure_invoke_method (Z_OBJ_P (obj ))) != NULL )
4191
4177
{
4192
- _fix_closure_prototype (closure );
4193
4178
mptr = closure ;
4194
4179
}
4195
4180
/* don't assign closure_object since we only reflect the invoke handler
@@ -4241,7 +4226,6 @@ ZEND_METHOD(reflection_class, getMethods)
4241
4226
if (Z_TYPE (intern -> obj ) != IS_UNDEF && instanceof_function (ce , zend_ce_closure )) {
4242
4227
zend_function * closure = zend_get_closure_invoke_method (Z_OBJ (intern -> obj ));
4243
4228
if (closure ) {
4244
- _fix_closure_prototype (closure );
4245
4229
_addmethod (closure , ce , return_value , filter , & intern -> obj );
4246
4230
_free_function (closure );
4247
4231
}
0 commit comments