@@ -3070,16 +3070,7 @@ static int zend_is_callable_check_func(int check_flags, zval *callable, zend_fca
3070
3070
get_function_via_handler :
3071
3071
if (fcc -> object && fcc -> calling_scope == ce_org ) {
3072
3072
if (strict_class && ce_org -> __call ) {
3073
- fcc -> function_handler = emalloc (sizeof (zend_internal_function ));
3074
- fcc -> function_handler -> internal_function .type = ZEND_INTERNAL_FUNCTION ;
3075
- fcc -> function_handler -> internal_function .module = (ce_org -> type == ZEND_INTERNAL_CLASS ) ? ce_org -> info .internal .module : NULL ;
3076
- fcc -> function_handler -> internal_function .handler = zend_std_call_user_call ;
3077
- fcc -> function_handler -> internal_function .arg_info = NULL ;
3078
- fcc -> function_handler -> internal_function .num_args = 0 ;
3079
- fcc -> function_handler -> internal_function .scope = ce_org ;
3080
- fcc -> function_handler -> internal_function .fn_flags = ZEND_ACC_CALL_VIA_HANDLER ;
3081
- fcc -> function_handler -> internal_function .function_name = mname ;
3082
- zend_string_addref (mname );
3073
+ fcc -> function_handler = zend_get_call_trampoline_func (ce_org , mname , 0 );
3083
3074
call_via_handler = 1 ;
3084
3075
retval = 1 ;
3085
3076
} else if (fcc -> object -> handlers -> get_method ) {
@@ -3088,15 +3079,15 @@ static int zend_is_callable_check_func(int check_flags, zval *callable, zend_fca
3088
3079
if (strict_class &&
3089
3080
(!fcc -> function_handler -> common .scope ||
3090
3081
!instanceof_function (ce_org , fcc -> function_handler -> common .scope ))) {
3091
- if (( fcc -> function_handler -> common .fn_flags & ZEND_ACC_CALL_VIA_HANDLER ) != 0 ) {
3082
+ if (fcc -> function_handler -> common .fn_flags & ZEND_ACC_CALL_VIA_TRAMPOLINE ) {
3092
3083
if (fcc -> function_handler -> type != ZEND_OVERLOADED_FUNCTION ) {
3093
3084
zend_string_release (fcc -> function_handler -> common .function_name );
3094
3085
}
3095
- efree (fcc -> function_handler );
3086
+ zend_free_trampoline (fcc -> function_handler );
3096
3087
}
3097
3088
} else {
3098
3089
retval = 1 ;
3099
- call_via_handler = (fcc -> function_handler -> common .fn_flags & ZEND_ACC_CALL_VIA_HANDLER ) != 0 ;
3090
+ call_via_handler = (fcc -> function_handler -> common .fn_flags & ZEND_ACC_CALL_VIA_TRAMPOLINE ) != 0 ;
3100
3091
}
3101
3092
}
3102
3093
}
@@ -3108,7 +3099,7 @@ static int zend_is_callable_check_func(int check_flags, zval *callable, zend_fca
3108
3099
}
3109
3100
if (fcc -> function_handler ) {
3110
3101
retval = 1 ;
3111
- call_via_handler = (fcc -> function_handler -> common .fn_flags & ZEND_ACC_CALL_VIA_HANDLER ) != 0 ;
3102
+ call_via_handler = (fcc -> function_handler -> common .fn_flags & ZEND_ACC_CALL_VIA_TRAMPOLINE ) != 0 ;
3112
3103
if (call_via_handler && !fcc -> object && EG (current_execute_data ) && Z_OBJ (EG (current_execute_data )-> This ) &&
3113
3104
instanceof_function (Z_OBJCE (EG (current_execute_data )-> This ), fcc -> calling_scope )) {
3114
3105
fcc -> object = Z_OBJ (EG (current_execute_data )-> This );
@@ -3250,14 +3241,13 @@ ZEND_API zend_bool zend_is_callable_ex(zval *callable, zend_object *object, uint
3250
3241
ret = zend_is_callable_check_func (check_flags , callable , fcc , 0 , error );
3251
3242
if (fcc == & fcc_local &&
3252
3243
fcc -> function_handler &&
3253
- ((fcc -> function_handler -> type == ZEND_INTERNAL_FUNCTION &&
3254
- (fcc -> function_handler -> common .fn_flags & ZEND_ACC_CALL_VIA_HANDLER )) ||
3244
+ ((fcc -> function_handler -> common .fn_flags & ZEND_ACC_CALL_VIA_TRAMPOLINE ) ||
3255
3245
fcc -> function_handler -> type == ZEND_OVERLOADED_FUNCTION_TEMPORARY ||
3256
3246
fcc -> function_handler -> type == ZEND_OVERLOADED_FUNCTION )) {
3257
3247
if (fcc -> function_handler -> type != ZEND_OVERLOADED_FUNCTION ) {
3258
3248
zend_string_release (fcc -> function_handler -> common .function_name );
3259
3249
}
3260
- efree (fcc -> function_handler );
3250
+ zend_free_trampoline (fcc -> function_handler );
3261
3251
}
3262
3252
return ret ;
3263
3253
@@ -3338,14 +3328,13 @@ ZEND_API zend_bool zend_is_callable_ex(zval *callable, zend_object *object, uint
3338
3328
ret = zend_is_callable_check_func (check_flags , method , fcc , strict_class , error );
3339
3329
if (fcc == & fcc_local &&
3340
3330
fcc -> function_handler &&
3341
- ((fcc -> function_handler -> type == ZEND_INTERNAL_FUNCTION &&
3342
- (fcc -> function_handler -> common .fn_flags & ZEND_ACC_CALL_VIA_HANDLER )) ||
3331
+ ((fcc -> function_handler -> common .fn_flags & ZEND_ACC_CALL_VIA_TRAMPOLINE ) ||
3343
3332
fcc -> function_handler -> type == ZEND_OVERLOADED_FUNCTION_TEMPORARY ||
3344
3333
fcc -> function_handler -> type == ZEND_OVERLOADED_FUNCTION )) {
3345
3334
if (fcc -> function_handler -> type != ZEND_OVERLOADED_FUNCTION ) {
3346
3335
zend_string_release (fcc -> function_handler -> common .function_name );
3347
3336
}
3348
- efree (fcc -> function_handler );
3337
+ zend_free_trampoline (fcc -> function_handler );
3349
3338
}
3350
3339
return ret ;
3351
3340
@@ -3414,14 +3403,13 @@ ZEND_API zend_bool zend_make_callable(zval *callable, zend_string **callable_nam
3414
3403
add_next_index_str (callable , zend_string_copy (fcc .function_handler -> common .function_name ));
3415
3404
}
3416
3405
if (fcc .function_handler &&
3417
- ((fcc .function_handler -> type == ZEND_INTERNAL_FUNCTION &&
3418
- (fcc .function_handler -> common .fn_flags & ZEND_ACC_CALL_VIA_HANDLER )) ||
3406
+ ((fcc .function_handler -> common .fn_flags & ZEND_ACC_CALL_VIA_TRAMPOLINE ) ||
3419
3407
fcc .function_handler -> type == ZEND_OVERLOADED_FUNCTION_TEMPORARY ||
3420
3408
fcc .function_handler -> type == ZEND_OVERLOADED_FUNCTION )) {
3421
3409
if (fcc .function_handler -> type != ZEND_OVERLOADED_FUNCTION ) {
3422
3410
zend_string_release (fcc .function_handler -> common .function_name );
3423
3411
}
3424
- efree (fcc .function_handler );
3412
+ zend_free_trampoline (fcc .function_handler );
3425
3413
}
3426
3414
return 1 ;
3427
3415
}
0 commit comments